How can you identify the IP class of a given IP Address?

Recommended Answers

All 4 Replies

Class A networks, start from 1.0.0.0 to 126.0.0.0.

Class B network addresses start from 128.0.0.0 to 191.255.0.0.

Class C network addresses start from 192.0.0.0 to 223.255.255.0.

Hope that helps

So, You check the range in which the network address you are checking fits, and then you will know what class it is.

If I may add some additional information to help clarify the thread...

What actually determines an IP's class in a classful network is actually the IP addresses's leading bits.

All Class A addresses will have first leading bit as zero (0). So, actually Class A's range is:
0.0.0.0 - 127.255.255.255.

What I mean by the leading bit is, if you convert the decimal value to binary for the first octect, you have 8 places. A Class A address must have a 0 in the first bit. In binary the range is:

00000000 - 01111111 which in Base 10 --> 0 - 127. We know that 127.0.0.1 is the loopback address, but it is still classified in the Class A range.

A Class B address, the first and second leading bit must be a '10' in binary. So for example, the range is: 10000000 - 10111111 which equals in Base 10 --> 128 - 191.

A Class C address, the first, second, and third bit must be '110' in binary. So for example, the range is: 11000000 - 11011111 which equals in Base 10 --> 192 - 223.

So, in summary, here are the Classes of A-C:

Class A     0.0.0.0     127.255.255.255
Class B     128.0.0.0   191.255.255.255
Class C     192.0.0.0   223.255.255.255

If you are interested in Class D and E, just continue with the pattern of leading bits.

Class D --> '1110'
Class E --> '1111'

Well done Jorge.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.