The Wayback Machine - https://web.archive.org/web/20241003044935/https://www.geeksforgeeks.org/introduction-of-classful-ip-addressing/
Open In App

Introduction of Classful IP Addressing

Last Updated : 16 Sep, 2024
Summarize
Comments
Improve
Suggest changes
Like Article
Like
Save
Share
Report
News Follow

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 addresses for houses; each device on a network needs its unique address to communicate with other devices. In this article, we will discuss Classful IP addresses, and their types in detail.

What is an IPV4 Address?

An IPv4 address is a unique number assigned to every device that connects to the internet or a computer network. It’s like a home address for your computer, smartphone, or any other device, allowing it to communicate with other devices.

  • Format: An IPv4 address is written as four numbers separated by periods, like this: 192.168.1.1. Each number can range from 0 to 255.
  • The IPv4 address is divided into two parts: Network ID and Host ID.
  • Purpose: The main purpose of an IPv4 address is to identify devices on a network and ensure that data sent from one device reaches the correct destination.
  • Example: When you type a website address into your browser, your device uses the IPv4 address to find and connect to the server where the website is hosted.
  • Host ID

Think of an IPv4 address as a phone number for your device. Just as you dial a specific number to reach a particular person, devices use IPv4 addresses to connect and share information.

There are two notations in which the IP address is written, dotted decimal and hexadecimal notation.

Dotted Decimal Notation

Some points to be noted about dotted decimal notation: 

  • The value of any segment (byte) is between 0 and 255 (both included).
  • No zeroes are preceding the value in any segment (054 is wrong, 54 is correct).
Dotted Decimal Notation

Dotted Decimal Notation

Hexadecimal Notation

Need For Classful Addressing

Initially in 1980’s IP address was divided into two fixed part i.e., NID(Network ID) = 8bit, and HID(Host ID) = 24bit. So there are 28 that is 256 total network are created and 224 that is 16M Host per network.

There are one 256 Networks and even a small organization must buy 16M computer(Host) to purchase one network. That’s why we need classfull addressing.

Classful Addressing

The 32-bit IP address is divided into five sub-classes. These are given below:

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

Each of these classes has a valid range of IP addresses. Classes D and E are reserved for multicast and experimental purposes respectively. The order of bits in the first octet determines the classes of the IP address. 

The class of IP address is used to determine the bits used for network ID and host ID and the number of total networks and hosts possible in that particular class. Each ISP or network administrator assigns an IP address to each device that is connected to its network. 

Classful Addressing

Classful Addressing 

Note: 

  • IP addresses are globally managed by Internet Assigned Numbers Authority(IANA) and Regional Internet Registries(RIR).
  • While finding the total number of host IP addresses, 2 IP addresses are not counted and are therefore, decreased from the total count because the first IP address of any network is the network number and whereas the last IP address is reserved for broadcast IP.
Occupation of The Address Space In The Classful Addressing

Occupation of The Address Space In Classful Addressing

Class A

IP addresses belonging to class A are assigned to the networks that contain a large number of hosts. 

  • The network ID is 8 bits long.
  • The host ID is 24 bits long.

The higher-order bit of the first octet in class A is always set to 0. The remaining 7 bits in the first octet are used to determine network ID. The 24 bits of host ID are used to determine the host in any network. The default subnet mask for Class A is 255.x.x.x. Therefore, class A has a total of:

  • 2^24 – 2 = 16,777,214 host ID

IP addresses belonging to class A ranges from 0.0.0.0 – 127.255.255.255. 

Class A

Class A

Class B

IP address belonging to class B is assigned to networks that range from medium-sized to large-sized networks. 

  • The network ID is 16 bits long.
  • The host ID is 16 bits long.

The higher-order bits of the first octet of IP addresses of class B are always set to 10. The remaining 14 bits are used to determine the network ID. The 16 bits of host ID are used to determine the host in any network. The default subnet mask for class B is 255.255.x.x. Class B has a total of: 

  • 2^14 = 16384 network address
  • 2^16 – 2 = 65534 host address

IP addresses belonging to class B ranges from 128.0.0.0 – 191.255.255.255.

Class B

Class B

Class C

IP addresses belonging to class C are assigned to small-sized networks.

  • The network ID is 24 bits long.
  • The host ID is 8 bits long.

The higher-order bits of the first octet of IP addresses of class C is always set to 110. The remaining 21 bits are used to determine the network ID. The 8 bits of host ID are used to determine the host in any network. The default subnet mask for class C is 255.255.255.x. Class C has a total of:

  • 2^21 = 2097152 network address
  • 2^8 – 2 = 254 host address

IP addresses belonging to class C range from 192.0.0.0 – 223.255.255.255.

Class C

Class C

Class D

IP address belonging to class D is reserved for multi-casting. The higher-order bits of the first octet of IP addresses belonging to class D is always set to 1110. The remaining bits are for the address that interested hosts recognize.

Class D does not possess any subnet mask. IP addresses belonging to class D range from 224.0.0.0 – 239.255.255.255.

Class D

Class D

Class E

IP addresses belonging to class E are reserved for experimental and research purposes. IP addresses of class E range from 240.0.0.0 – 255.255.255.255. This class doesn’t have any subnet mask. The higher-order bits of the first octet of class E are always set to 1111.

Class E

Class E

Range of Special IP Addresses

169.254.0.0 – 169.254.0.16 : Link-local addresses
127.0.0.0 – 127.255.255.255 : Loop-back addresses
0.0.0.0 – 0.0.0.8: used to communicate within the current network.

Rules for Assigning Host ID

Host IDs are used to identify a host within a network. The host ID is assigned based on the following rules:

  • Within any network, the host ID must be unique to that network.
  • A host ID in which all bits are set to 0 cannot be assigned because this host ID is used to represent the network ID of the IP address.
  • Host ID in which all bits are set to 1 cannot be assigned because this host ID is reserved as a broadcast address to send packets to all the hosts present on that particular network.

Rules for Assigning Network ID

Hosts that are located on the same physical network are identified by the network ID, as all host on the same physical network is assigned the same network ID. The network ID is assigned based on the following rules:

  • The network ID cannot start with 127 because 127 belongs to the class A address and is reserved for internal loopback functions.
  • All bits of network ID set to 1 are reserved for use as an IP broadcast address and therefore, cannot be used.
  • All bits of network ID set to 0 are used to denote a specific host on the local network and are not routed and therefore, aren’t used.

Summary of Classful Addressing 

Summary of Classful addressing

In the above table No. of networks for class A should be 127. (Network ID with all 0 s is not considered)

Problems With Classful Addressing

The problem with this classful addressing method is that millions of class A addresses are wasted, many of the class B addresses are wasted, whereas, the number of addresses available in class C is so small that it cannot cater to the needs of organizations. Class D addresses are used for multicast routing and are therefore available as a single block only. Class E addresses are reserved.

Since there are these problems, Classful networking was replaced by Classless Inter-Domain Routing (CIDR) in 1993. We will be discussing Classless addressing in the next post.

  • The network ID is 24 bits long.
  • The host ID is 8 bits long.
  • 2^21 = 2097152 network address
  • 2^8 – 2 = 254 host address
  • Within any network, the host ID must be unique to that network.
  • Host ID in which all bits are set to 0 cannot be assigned because this host ID is used to represent the network ID of the IP address.
  • Host ID in which all bits are set to 1 cannot be assigned because this host ID is reserved as a broadcast address to send packets to all the hosts present on that particular network.
  • The network ID cannot start with 127 because 127 belongs to the class A address and is reserved for internal loopback functions.
  • All bits of network ID set to 1 are reserved for use as an IP broadcast address and therefore, cannot be used.
  • All bits of network ID set to 0 are used to denote a specific host on the local network and are not routed and therefore, aren’t used.

Classful and Classless Addressing

Here is the main diffrence between Classful 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

Classful IP addressing, with its categorization into classes like A, B, and C, was a fundamental method in early networking. It organized IP addresses based on network size but faced limitations in flexibility and efficient use of address space. The development of CIDR addressed these issues by allowing more precise control over subnetting and optimizing address allocation.

Frequently Asked Questions on Classful IP Addressing

What is classful addressing in IP?

A classful network is an old way of organizing IP addresses on the Internet. It was used from 1981 until 1993 when a new system called Classless Inter-Domain Routing (CIDR) replaced it. This method split IP addresses for Internet Protocol version 4 (IPv4) into five classes based on the first four bits of the address.

What is classful and classless routing protocol?

Classful routing protocols, like RIP and IGRP, do not include subnet mask information in updates, assuming default classes (A, B, or C). Classless routing protocols, such as OSPF, EIGRP, and BGP, include subnet mask information, allowing more flexible IP address usage.

What is Class AB and C IP address?

Class A IP addresses (1.0.0.0 to 126.255.255.255) have a default subnet mask of 255.0.0.0 and are used for large networks. Class B addresses (128.0.0.0 to 191.255.255.255) have a subnet mask of 255.255.0.0 for medium-sized networks. Class C addresses (192.0.0.0 to 223.255.255.255) have a subnet mask of 255.255.255.0 for small networks.

What is the subnet mask for a classful class a IP range?

The subnet mask for a classful Class A IP range is 255.0.0.0, with the first 8 bits for the network portion and the remaining 24 bits for the host portion.

How does Classful IP Addressing handle subnetting?

Classful IP addressing does not support subnetting in the way that Classless Inter-Domain Routing (CIDR) does. Each class has a fixed subnet mask, which limits the flexibility in dividing networks into smaller subnets.



Previous Article
Next Article

Similar Reads

Classful vs Classless Addressing
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
7 min read
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
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
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
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
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 IP Addressing and Subnetting
In computer network IP addressing and subnetting both are improtant concepts. An IP address is a unique identifier assigned to devices on a network to enable communication. It consists of two parts: the network and host address. Where as subnetting is a technique used to divide a larger IP network into smaller, more manageable sub-networks (subnets
5 min read
Introduction of Internetworking
Internetworking is combined of 2 words, inter and networking which implies an association between totally different nodes or segments. This connection area unit is established through intercessor devices akin to routers or gateway. The first term for associate degree internetwork was catenet. This interconnection is often among or between public, p
8 min read
Introduction of Virtual Router Redundancy Protocol (VRRP) and its configuration
VRRP is an open standard protocol, which is used to provide redundancy in a network. It is a network layer protocol (protocol number-112). The number of routers (group members) in a group acts as a virtual logical router which will be the default gateway of all the local hosts. If one router goes down, one of the other group members can take place
4 min read
Introduction to Crypto-terminologies
Cryptography is an important aspect when we deal with network security. 'Crypto' means secret or hidden. Cryptography is the science of secret writing with the intention of keeping the data secret. Cryptanalysis, on the other hand, is the science or sometimes the art of breaking cryptosystems. Both terms are a subset of what is called Cryptology. C
4 min read
Introduction to Sniffers
Introduction: A sniffer, also known as a packet analyzer or network analyzer, is a tool used to capture and analyze network traffic. It is a software or hardware tool that intercepts and records data packets transmitted between computers or devices on a network. Packet sniffers are commonly used for network troubleshooting, security analysis, and n
3 min read
Introduction to basic Networking Terminology
For a specific purpose if things are connected together, are referred to as a NETWORK. A network can be of many types, like a telephone network, television network, computer network, or even a people network. Similarly, a COMPUTER NETWORK is also a kind of setup, where it connects two or more devices to share a range of services and information in
4 min read
Generative Adversarial Networks (GANs) | An Introduction
Generative Adversarial Networks (GANs) was first introduced by Ian Goodfellow in 2014. GANs are a powerful class of neural networks that are used for unsupervised learning. GANs can create anything whatever you feed to them, as it Learn-Generate-Improve. To understand GANs first you must have little understanding of Convolutional Neural Networks. C
6 min read
Introduction to Hacking
There are various definitions one can get to know about hackers. The term hacker was used in the early 1990s and it was to describe someone who could be a great programmer and had the ability to solve complex problems. Now the definition of the hacker changed from time to time as it started to gain a negative vibe by the media. The media started to
3 min read
Introduction to Wireshark
Wireshark is a software tool used to monitor the network traffic through a network interface. It is the most widely used network monitoring tool today. Wireshark is loved equally by system administrators, network engineers, network enthusiasts, network security professionals and black hat hackers. The extent of its popularity is such, that experien
4 min read
Introduction of Botnet in Computer Networks
A Network of compromised computers is called a botnet. Compromised computers are also called Zombies or Bots. This software is mostly written in C++ & C. The main motive of botnet is that it starts with the dark side of the internet which introduced a new kind of Crime called Cybercrime. Among the malware (malicious software) botnet is the most
5 min read
Introduction of ZigBee
ZigBee is a Personal Area Network task group with low rate task group 4. It is a technology of home networking. ZigBee is a technological standard created for controlling and sensing the network. As we know that ZigBee is the Personal Area Network of task group 4 so it is based on IEEE 802.15.4 and is created by Zigbee Alliance. ZigBee is an open,
5 min read
Introduction of Server
Servers are dedicated computers for a specific purpose, and unlike the Desktop computer these computers are made for durability, longevity and for working longer periods of time as compared to a desktop PC. Functions of a Server : A server is made to provide services and functionality to other computers. The other computers which are using the serv
4 min read
Introduction of Computer Forensics
INTRODUCTION Computer Forensics is a scientific method of investigation and analysis in order to gather evidence from digital devices or computer networks and components which is suitable for presentation in a court of law or legal body. It involves performing a structured investigation while maintaining a documented chain of evidence to find out e
4 min read
Introduction to Keyloggers
Key loggers also known as keystroke loggers, may be defined as the recording of the key pressed on a system and saved it to a file, and the that file is accessed by the person using this malware. Key logger can be software or can be hardware. Working: Mainly key-loggers are used to steal password or confidential details such as bank information etc
4 min read
Introduction To RAT - Remote Administration Tool
Remote administration means controlling or getting access to any device from another location remotely. Software that allows remote administration is known as Remote Administration Tools. So RAT gives someone access to remotely access your device as you are doing it physically but from any other location. With these tools, another person can access
4 min read
Introduction To Classic Security Models
These models are used for maintaining goals of security, i.e. Confidentiality, Integrity, and Availability. In simple words, it deals with CIA Triad maintenance. There are 3 main types of Classic Security Models. Bell-LaPadula BibaClarke Wilson Security Model1. Bell-LaPadula This Model was invented by Scientists David Elliot Bell and Leonard .J. La
3 min read
Introduction To Security Defense Models
These models are mainly used for Defense Purpose i.e., securing the data or the asset. There are 2 main types of Security Defense Models: Lollipop Model, and Onion Model. These are explained as following below. 1. Lollipop Model : Lollipop Model is Defense Model associated with an analogy of a Lollipop. A lollipop is having a chocolate in the middl
2 min read
Introduction to OPSEC?
Operation Security (OPSEC) is a process in which it is made sure that no information of an organization is revealed i.e., OPSEC is used to remove all the loopholes that could be used by someone to steal confidential information related to an office, firm, or organization. It can use both the analytical and strategical approach to remove risk of som
2 min read
Introduction of High Speed Downlink Packet Access (HSDPA)
HSDPA stands for High Speed Downlink Packet Access. It provides faster download speeds. It is an upgrade from the form of UMTS. HSDPA provides a download rate of up to 7.2 Mbps. HSDPA is an enhanced 3G mobile telephone communications protocol. The 3.5G, 3G+ or turbo 3G, which allows networks based on Universal Mobile Telecommunications System to ha
4 min read
Introduction to Netcat
Netcat or NC is a utility tool that uses TCP and UDP connections to read and write in a network. It can be used for both attacking and security. In the case of attacking. It helps us to debug the network along with investigating it. It runs on all operating systems. Getting Started with Netcat To start NC, the most basic option we can use the help
3 min read
Botnet Forensics - An Introduction
Botnets are the programs that are executed by a malicious programmer known as a botmaster or botherder. Botherder sends the infection or viruses to the feeble user’s computer whose payload is a malicious application. It connects through the command and control server. Spammer purchase the services from the botherder and botherder then itself issues
6 min read