What are the Classes of IPv4?

A computer’s IP address is analogous to a car’s license plate in that it uniquely identifies it on the internet. The IPv4 addressing scheme is a notion that defines the Internet’s addressing framework. There are 5 different classes of IPv4 which we will discuss further.

Learn everything there is to know about IPv4 addresses and the different IPv4 address families right here. We also explain how to use the IPv4 Address to determine the IP class.

Classes of IPv4
Classes of IPv4

The internet’s address architecture

The “host” portion of an IP address is the device that is being addressed, while the “network” portion specifies the network that is doing the addressing. There are 32 digits in an IPv4 address. Together, they reveal the identity of online gadgets. There is a critical need for both the host address and the network address.

In a local area network, the host address could be enough, but networks require the network address for identification. The network address is used by routers to provide smooth communication between hosts on various networks.

The 32-bit IP address is a binary string consisting only of ones and zeroes. Octets are a useful way to organize binary numbers (eight numbers each). When written in decimal form, it becomes an Internet Protocol address in dotted-decimal form.

Example of dotted-decimal notation

Think about an Internet Protocol (IP) address:

1001010000011110111010100010101

The following form can be used to represent this value in octets:

10010100 00011110 1110101 00010101

Let’s go ahead and do a binary-to-decimal conversion for each octet. The outcome appears like this:

148 30 117 21

The Internet Protocol address appears here in dotted-decimal form: 148.30.117.21.

Class Numbers

When working with an IP address, how do you determine the host and network numbers? Consequently, it was decided to devise a classification scheme to aid in the identification of the respective network and host numbers.

The first octet of an IP address was used to divide all addresses into one of five groups.

Within this framework, there are five distinct types:

1. Class A

2. Class B

3. Class C

4. Class D

5. Class E

When assigning an IP address to a host, only Classes A, B, and C are used. With multicasting, you’ll need an address of Class D. Experiments typically use Class E addresses. Understanding how the host and network numbers are determined requires further information about these classes.

Class A addresses

Keep in mind the IP address’s first octet. Class A addresses have a zero as the first digit. Class A addresses have an IP range from 1.0.0.0 to 127.0.0.0. The numbers 1 and 127 cannot be used in the first octet of other IPv4 classes.

The host address takes up the remaining octets, whereas the first octet represents the network. With 24 bits still available, there are 16,777,216 possible possibilities. That’s three octets. These two are taken, leaving a total of 16,777,214 available host addresses.

There are evidently 126 Class A addresses, each of which has around 17 million. As their name suggests, Class A addresses are designed for extremely large networks. Consequently, a small group of companies has monopoly on the majority of IP addresses.

To maximize efficiency, networks are typically divided into subnets because no single network could possibly handle 65,000 hosts. Subnetting masks, also known as subnet masks, are 32-bit integers in which each bit matches a byte in an IP address. In order to keep IP addresses from being wasted and to keep them organized in a sensible fashion, the idea of subnets was developed. 

Class B addresses

Class B addresses begin with the value 10 in the first two bits of the first octet. A Class B address has a public IP range from 128.0.0.0 to 191.255.0.0. These addresses are reserved for organizations of a moderate size. Network numbers are the first two octets, and host numbers are the second pair. In a Class B network, there is room for 65,534 hosts. 

Class C addresses

The first digit of a Class C number is 110. IPv4 addresses with a public IP range from 192.0.0.0 to 223.255.255.0 are classified as Class C addresses. Addresses like this are set aside for use by private networks.

It’s common knowledge that the supply of Class A and Class B mailing addresses is running low. Since then, no new businesses have been able to obtain IP addresses from any other pool except Class C.

The following shows the total number of networks and the number of hosts in each network category.

• For each of Class A’s 127 networks (two of which are reserved), there are 16,777,214 potential hosts.

• Class B allows for 16,384 distinct networks, each with 65,534 hosts.

• There are 2,097,152 distinct networks in Class C, with a maximum of 254 hosts per network.

Class D addresses

Only multicasting can use these addresses. The first octet of these numbers is 1110. For Class D addresses, the first octet must be between 224 and 239. The IP range is from 224.0.0.0 to 239.255.255.255

Class E addresses

In a Class E address, the first octet always begins with 1111. Class E addresses, thus, have a public IP range from 224.0.0.0 to 239.255.255.255. There is a restriction on the use of certain addresses. In other words, they should only be used in the lab.

Final Thoughts

These are the five main classes of IPv4. The first 8 bits of a class A network identify the network, and the next 24 bits identify the host. The first 16 bits—two octets—identify class B networks. The remaining 16 bits identify the network host. Class C indents networks with three octets. 192–223 is this IP. 32-bit Class D network addresses. Multicast groups are uniquely identified by all range values. Class E IP addresses include the first four network address bits as 1. IP address classes’ biggest issue is running out of address space. Network IDs cannot start with 127 because class A addresses are reserved for internal loopback operations.