A hierarchical IP address or IPv4 contains various classes in its address. IPv4 is 32 bits binary numbers. IP address assignment on the network entirely depends on Internet Corporation for Assigned Names and Numbers (ICANN). Based on the requirement of hosts per network, Internet Protocol version 4 or IPv4 is broken into five classes and these classes can be easily identified by the first octet of IP address.
- Class A
- Class B
- Class C
- Class D
- Class E
Note: All these classes of IP addresses can be identified by the first octet of the address.
How to find the Network and Host number in an IP address?
You can use the below formula to find the total number of networks and Host per class in an IP address.
- Number of Networks: 2Network bits
- Number of Host per Network: 2Host bits-2
When calculating the number of hosts per network, two IPs are always subtracted from the total IPs because the first IP of a network is always reserved for the network number and the last IP is reserved for Broadcast IP. Refer above formula to find the number of Host per Network (2Host bits-2).
Class A: IPv4 Address classes
In Class “A” addresses:
The first bit of the first octet is set to zero (0), and this first octet or first dotted-decimal represents the Network part of this address. The First octet ranges from 1-127 or 00000000-01111111.
Excluding the first octet or first dotted-decimal part, the remaining will be the Host part of this address.
Note: Class “A” IP address ranges between 1 to 126 only, because IP 127 is reserved for Loopback address.
- Number of possible Networks in Class A = 28-1= 27 = 127
- Number of Hosts in class A (2Host bits-2) = 224-2= 16777214
- The default subnet mask for class A = 255.0.0.0
- IP format for class A = 0NNNNNNN.HHHHHHHH.HHHHHHHH.HHHHHHHH
Class B: IPv4 Address classes
In class “B” addresses:
The first bit is set to 1 and the second bit set to 0, and the first 16 bits or the first two dotted-decimal represents the Network part of the address. Further, the remaining part would be the Host of the address.
Note: Class “B” IP address ranges between 126.96.36.199 to 188.8.131.52 and 2 bits are reserved for Loopback address.
- Hence, the Number of possible Networks in class B = 214=16384
- Number of Hosts per network in class B = 216-2-2 = 65534
- The default subnet mask for class B = 255.255.0.0
- IP format for class B = 10NNNNNN.NNNNNNNN.HHHHHHHH.HHHHHHHH
Class C: IPv4 Address classes
In class “C” addresses:
The first two bits set to 1 and the third bit set to 0 which means the first 24 bits are the network part of the IP address and the remaining will be the Host.
Note: Class “C” IP addresses range between 192.0.0.0 to 184.108.40.206 and 3 bits are reserved for Loopback address.
- Hence, the Number of possible Networks in Class “C”= 224-3= 221= 2097152
- Number of Hosts per network in class C = 28-2 = 254
- The default subnet mask for class C = 255.255.255.0
- IP format for class C = 110NNNNN.NNNNNNNN.NNNNNNNN.HHHHHHHH
Class D: IPv4 Address Classes
Unlike Class A, B, and C, Class D addresses are not used for normal networking operations. Class D IP addresses are used for Multicasting applications.
In Class D addresses;
The first three bits are set to 1 and the fourth bit set to 0. All 32 bits are reserved for the Network part and used for multicasting applications.
Note: Class D IP addresses ranges between 220.127.116.11 to 18.104.22.168. It is reserved for Multicasting data hence; it doesn’t require any Host in their addressing. Further, Class D addresses don’t have any subnet mask.
Class E: IPv4 Address classes
The uses of Class E addresses are reserved for Study or Research and Development purposes. In this class, the first four network bits are set to 1 hence; it ranges between 240.0.0.0 to 255.255.255.255.
Similar to the Class D address, Class E also doesn’t have any subnet mask.
Bit-wise representation in IP address classes
Class A: (0.0.0.0 – 127.255.255.255)
- 0. 0. 0 = 00000000.00000000.00000000.00000000
- 127.255.255.255 = 01111111.11111111.11111111.11111111
Class B: (128. 0. 0. 0 – 22.214.171.124)
- 128. 0. 0. 0 = 10000000.00000000.00000000.00000000
- 126.96.36.199 = 10111111.11111111.11111111.11111111
Class C: (192. 0. 0. 0 – 188.8.131.52)
- 192. 0. 0. 0 = 11000000.00000000.00000000.00000000
- 184.108.40.206 = 11011111.11111111.11111111.11111111
Class D: (224. 0. 0. 0 – 220.127.116.11)
- 224. 0. 0. 0 = 11100000.00000000.00000000.00000000
- 18.104.22.168 = 11101111.11111111.11111111.11111111
Class E: (240. 0. 0. 0 – 255.255.255.255)
- 240. 0. 0. 0 = 11110000.00000000.00000000.00000000
- 255.255.255.255 = 11111111.11111111.11111111.11111111
IP Address classes: Chart Representation
|Address Classes||Range||Bit Pattern of 1st byte||Decimal Range||Default Subnet Mask||Reserved for|
|A||22.214.171.124 to 126.96.36.199||0xxxxxxx||1 to 127||255.0.0.0||Governments|
|B||188.8.131.52 to 184.108.40.206||10xxxxxx||128-191||255.255.0.0||Medium Companies|
|C||192.0.0.0 to 220.127.116.11||110xxxxx||192-223||255.255.255.0||Small Companies|
|D||18.104.22.168 to 22.214.171.124||1110xxxx||224-239||Not Applicable||Reserved for Multicasting|
|E||240.0.0.0 to 255.255.255.255||11110xxx||240-255||Not Applicable||Experimental or future use|