IP Address Classes
IP Address Classes
There are two versions of IP addresses, IPv4 and IPv6. In this tutorial, we will discuss how IPv4
organizes IP addresses. In IPv4, there are 4,294,967,296 IP addresses. These addresses are
organized into five IP classes. These classes are A, B, C, D, and F.
Before we understand how IP addresses are organized in these classes, let's briefly discuss how
IP addresses are written and structured.
IP addresses notation
Computers understand only the binary system. The binary system uses bits to store and process
data. A bit can store only two values: zero (0) and one (1). If the value 'zero' is stored, the bit is
known as the OFF bit. If the value 'one' is stored, the bit is known as ON bit. The binary system
uses a unique combination of ON and OFF bits for each letter and number.
Using IP addresses in the binary format is not easy. But the good news is that unless you are a
software developer or a network administrator, you never need to write and use IP addresses in
binary notation. You can write and use them in decimal format. The software program that you
use to assign the IP address on the interface automatically converts the assigned IP address into
binary format.
If you are a software developer or a network administrator, you can also use IP addresses in
decimal format. But you should also understand how IP addresses work in the binary system.
Since interfaces use the binary system to process IP addresses, learning IP addresses in binary
format can make your IP related tasks easy.
In short, you can write and use IP addresses in two notations: binary notation and decimal-
dotted notation. In binary notation, all the individual bits of each byte are expressed as a binary
number. In decimal notation, all four binary bytes are converted and expressed to their decimal
equivalent numbers.
IP addresses structure
An IP address consists of 32 bits. These bits are divided into four sections. Sections are
separated by a dot (.). Each section contains 8 bits. 8 bits are equal to 1 byte or 1 octet. The
following image shows how bits are organized in an IP address.
By using 32 bits with two possible values for each position, the binary system can create
4,294,967,296 (232) unique combinations or IP addresses. These addresses can be used without
any addressing scheme or with an addressing scheme that arranges them in such a way that it
becomes easier to access them.
If addresses are used without any addressing scheme, all routers on the network will need to
store the address of each and every interface on the network. Depending on the size of the
network, this may affect routing. If the network size is small, it can make routing slow. If the
network size is moderate, it can make routing very slow. If the network size is large, it can make
routing completely impossible.
For efficient routing, addresses are organized into the hierarchical addressing scheme. In this
scheme, all addresses are divided into five classes and each address is divided into two
addresses: the network address and the host address.
IP address classes
Based on the following rules, IP addresses are categorized into five classes; A, B, C, D, and E.
In class A, the first bit of the first byte always remains OFF (0).
In class B, the first bit of the first byte always remains ON and the second bit of the first byte
always remains OFF.
In class C, the first two bits of the first byte always remain ON and the third bit of the first byte
always remains OFF.
In class D, the first three bits of the first byte always remain ON and the fourth bit of the first
byte always remains OFF.
In class E, the first four bits of the first byte always remain ON.
By turning all remaining bits of the first byte ON and OFF, we can make the first and last
address of that class.
The following table lists the value of the first byte or octet in both notations.
Class Fix bits First address (binary notation) Last address (binary notation) First address (decimal notation) Last
addre
(decim
notati
Network addresses are used to combine multiple IP addresses in a group while host addresses
are used to provide a unique identity to each IP address in the group. A network address is the
group address. All group members use the same network address. A host address is a unique
address in the group.
To learn more about how the network addresses and host addresses work, you can check the
following tutorial.
The length of network addresses and host addresses in IP addresses are different in all IP
classes. In class A, the first bits are reserved for the network address. The remaining 24 bits are
available for the host address. In class B, the first 16 bits are reserved for the network address
while the last 16 bits are available for the host address. In class C, the first 24 bits are reserved
for the network address while the last 8 bits available for the host address.
The following image shows how bits are defined for network addresses and host addresses in
each IP class.
In IP addresses, host bits are flexible. Administrators can adjust the length of host bits to meet
the requirements of their networks. They can use host bits as network bits to utilize maximum
addresses from all available addresses. If hosts bits are used as the network bits, this is known
as the subnetting.
Class D and E are not used for the host addressing. Class D addresses are used for multicast
addresses. Class E addresses are reserved for research and development purposes. Multicast
addresses are explained in the following tutorial.
IP addresses are always written with the subnet mask. The following table lists the default
subnet mask for all IP classes.
A 255.0.0.0 11111111.00000000.00000000.00000000
Examples of IP addresses
Examples of class A IP addresses are the following.
1.2.3.4 00000001.00000010.00000011.00000100
255.0.0.0 11111111.00000000.00000000.00000000
10.10.10.10 00001010.00001010.00001010.00001010
255.0.0.0 11111111.00000000.00000000.00000000
25.147.191.14 00011001.10010011.10111111.00001110
255.0.0.0 11111111.00000000.00000000.00000000
95.86.75.4 01011111.01010110.01001011.00000100
255.0.0.0 11111111.00000000.00000000.00000000
127.0.0.1 01111111.00000000.00000000.00000001
255.0.0.0 11111111.00000000.00000000.00000000
129.12.36.42 10000001.00001100.00100100.00101010
255.255.0.0 11111111.11111111.00000000.00000000
168.172.1.1 10101000.10101100.00000001.00000001
255.255.0.0 11111111.11111111.00000000.00000000
175.66.43.12 10101111.01000010.00101011.00001100
255.255.0.0 11111111.11111111.00000000.00000000
145.186.175.234 10010001.10111010.10101111.11101010
255.255.0.0 11111111.11111111.00000000.00000000
190.60.152.25 10111110.00111100.10011000.00011001
255.255.0.0 11111111.11111111.00000000.00000000
192.168.1.1 11000000.10101000.00000001.00000001
255.255.255.0 11111111.11111111.11111111.00000000
210.20.30.40 11010010.00010100.00011110.00101000
255.255.255.0 11111111.11111111.11111111.00000000
216.123.145.16 11011000.01111011.10010001.00010000
255.255.255.0 11111111.11111111.11111111.00000000
220.86.76.43 11011100.01010110.01001100.00101011
255.255.255.0 11111111.11111111.11111111.00000000
220.60.80.100 11011100.00111100.01010000.01100100
255.255.255.0 11111111.11111111.11111111.00000000