# IP Address Classes Explained with Examples

This tutorial explains IP address classes in detail through examples. Learn how IP addresses are organized in IP classes and how to identify the class of an IP address.

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.

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.

In this tutorial, we will understand IP classes in both notations.

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.

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 address (decimal notation) A 0 00000000 01111111 0 127 B 10 10000000 10111111 128 191 C 110 11000000 11011111 192 223 D 1110 11100000 11101111 224 239 E 1111 11110000 11111111 240 255

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.

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 use an additional component to distinguish between network addresses and host addresses. This component is known as the subnet mask. In simple words, the subnet mask tells, how many bits in the IP address are used as the network address and how many bits are left for the host address.

IP addresses are always written with the subnet mask. The following table lists the default subnet mask for all IP classes.

 Class Decimal notation Binary notation A 255.0.0.0 11111111.00000000.00000000.00000000 B 255.255.0.0 11111111. 11111111.00000000.00000000 C 255.255.255.0 11111111. 11111111. 11111111.00000000

#### Identifying the class of an IP address (decimal notation)

If an IP address is written in the decimal notation, check the value of the first section or octet and use the following rules to identify the class of the IP address.

• If the value is in the range 1 to 127, the address belongs to class A.
• If the value is in the range 128 to 191, the address belongs to class B.
• If the value is in the range 192 to 223, the address belongs to class C.
• If the value is in the range 224 to 239, the address belongs to class D.
• If the value is in the range 240 to 255, the address belongs to class E.

#### Identifying the class of an IP address (binary notation)

If an IP address is written in the binary notation, you can use the following rules to identify the class of the IP address.

• If the first bit is OFF, the address belongs to class A.
• If the first bit is ON and the second bit is OFF, the address belongs to class B.
• If the first two bits are ON and the third bit is OFF, the address belongs to class C.
• If the first three bits are ON and the fourth bit is OFF, the address belongs to class D.
• If the first four bits are ON, the address belongs to class E.

Examples of class A IP addresses are the following.

 Decimal notation Binary notation 1.2.3.4 255.0.0.0 00000001.00000010.00000011.00000100 11111111.00000000.00000000.00000000 10.10.10.10 255.0.0.0 00001010.00001010.00001010.00001010 11111111.00000000.00000000.00000000 25.147.191.14 255.0.0.0 00011001.10010011.10111111.00001110 11111111.00000000.00000000.00000000 95.86.75.4 255.0.0.0 01011111.01010110.01001011.00000100 11111111.00000000.00000000.00000000 127.0.0.1 255.0.0.0 01111111.00000000.00000000.00000001 11111111.00000000.00000000.00000000

Examples of class B IP addresses are the following.

 Decimal notation Binary notation 129.12.36.42 255.255.0.0 10000001.00001100.00100100.00101010 11111111.11111111.00000000.00000000 168.172.1.1 255.255.0.0 10101000.10101100.00000001.00000001 11111111.11111111.00000000.00000000 175.66.43.12 255.255.0.0 10101111.01000010.00101011.00001100 11111111.11111111.00000000.00000000 145.186.175.234 255.255.0.0 10010001.10111010.10101111.11101010 11111111.11111111.00000000.00000000 190.60.152.25 255.255.0.0 10111110.00111100.10011000.00011001 11111111.11111111.00000000.00000000

Examples of class C IP addresses are the following.

 Decimal notation Binary notation 192.168.1.1 255.255.255.0 11000000.10101000.00000001.00000001 11111111.11111111.11111111.00000000 210.20.30.40255.255.255.0 11010010.00010100.00011110.0010100011111111.11111111.11111111.00000000 216.123.145.16 255.255.255.0 11011000.01111011.10010001.00010000 11111111.11111111.11111111.00000000 220.86.76.43 255.255.255.0 11011100.01010110.01001100.0010101111111111.11111111.11111111.00000000 220.60.80.100 255.255.255.0 11011100.00111100.01010000.01100100 11111111.11111111.11111111.00000000

Thatâ€™s all for this tutorial. In this tutorial, we discussed IP addresses and learned how IP addresses are organized into classes.

ComputerNetworkingNotes Networking Tutorials IP Address Classes Explained with Examples