AfterAcademy Tech
•
29 Feb 2020

IP addressing is the most popular way to identify a device on the network. The address has 32 bits which can be broken into four octets(1 octet=8 bit). These octets provide an addressing method through which we can accommodate large and small networks. Accordingly, there are 5 classes of the network about which we will study in this blog. So, let's get started.
IP version 4 is 32 bits long. The maximum value of a number that can be formed by using 32 bits is 2³². So, the maximum number of IPv4 addresses is 4,294,967,296 addresses i.e. 2³² addresses. It consists of four octets each of which can contain one to three digits ranging from 0 to 255 separated by a single dot(.). Here, each number is the decimal representation(base-10) for an 8 digit binary number(base-2).
Example of an IPv4 address: 63.171.234.171

The order of the bits in the first octet of the IP address decides the class of the IP address.
Some bits of the IP address represents the network and the remaining bits represent the host. The IP address can be further be divided into two parts:
Network ID: It identifies which network you are on. The number of networks in any class is given by the formula:
Number of Networks= 2^networkBits
Host ID: It identifies your machine on the network. The number of hosts in any class is given by the formula:
Number of Hosts= 2^hostBits-2.
Here, 2 IP addresses are subtracted because
The IP address belonging to Class A uses only the first octet to identify the network and the last three octets are used to identify the host.
The first bit of the first octet is always set to 0.

The default subnet mask for Class A IP address is 255.0.0.0. Subnet masks are used to tell hosts on the network which part is the network address and which part is the host address of an IP address.
How does the subnet mask do this?
Suppose you have an IP address as
10.20.15.3 = 00001010.00010100.00001111.00000011
and the mask as,
255.0.0.0 = 11111111.00000000.00000000.00000000
The IP address bits that have corresponding mask bits as 1 represents the network ID and the address bits that have corresponding mask bits as set to 0 represent the host ID.
10.20.15.1 = 00001010.00010100.00001111.00000001
255.0.0.0 = 11111111.00000000.00000000.00000000
by comparing corresponding bits of address bits and mask bits we get,
netid = 00001010 = 10
hostid = 00010100.00001111.00000011 = 20.15.3
Class A has:
The IP address belonging to Class A range from 1.a.a.a to 126.a.a.a.(where a ranges from 0 to 255)
The IP address belonging to Class B uses the first two octets to identify the network and the last two octets are used to identify the host.
The first two bit of the first octet is always set to 10.

The subnet mask for class B is 255.255.0.0.
So, class B has:
The IP address belonging to Class B range from 128.0.a.a to 191.255.a.a.(where a ranges from 0 to 255)
The IP address belonging to Class C uses the first three octets to identify the network and the last octet is used to identify the host.
The first two bit of the first octet is always set to 110.

The subnet mask for class B is 255.255.255.0.
So, class C has:
The IP address belonging to Class C range from 192.0.0.a to 223.255.255.a.(where a ranges from 0 to 255)
The IP address belonging to Class D has the first four bits of the first octet set as 1110. The remaining bits are the host bits.

The IP address belonging to Class D range from 224.0.0.0 to 239.255.255.255.
Class D is reserved for multicasting. Also, this class doesn't have any subnet mask.
The IP address belonging to Class E has the first four bits of the first octet set as 1111. The remaining bits are the host bits.

The IP address belonging to Class D range from 240.0.0.0 to 255.255.255.254.
This class is reserved for future use, research and development purposes. It also doesn't have any subnet mask.
So, using the above knowledge given an IP address you can identify the class of the IP address.
You can do it by looking at the first octet of the IP address. Convert the dotted-decimal IP address to its binary equivalent.
Alternatively, you can learn the range of IP addresses of each class.
That’s it for this blog. Hope you learned something new today.
Do share this blog with your friends to spread the knowledge. Visit our YouTube channel for more content. You can read more blogs from here.
Keep Learning 🙂
Team AfterAcademy!
AfterAcademy Tech
In this blog, we will learn what is an Ip address and what are the various versions of IP addresses being used. We will also discuss what are the types of IP addresses depending upon how they are assigned to any system.

AfterAcademy Tech
In this blog, we will first learn about the MAC and IP addresses in brief. And then, we'll see the dissimilarities between the two.

AfterAcademy Tech
In this blog, we will discuss IPv4 and IPv6 versions of IP address. We will also discuss in details about their packet formats and finally see the differences among them.

AfterAcademy Tech
In this blog, we will mainly learn about the TCP/IP model and its working in detail. We'll focus on the features and working of each layer of the TCP/IP model.
