How many number of hosts do IP classes A, B, and C have?

13,572

Yes, I think you do have slight misunderstanding. This topic is explained reasonably well in the Wikipedia "Classful network" article.

Classes are defined by leading bits of the first octet:

  • 0 - Class A (128 networks)
  • 10 - Class B (16384 networks)
  • 110 - Class C (2097152 networks)
  • 1110 - Class D (Multicast)
  • 1111 - Class E

All 128 Class A network have total of 2147483648 distinct host addresses. This number is reached by multiplying total number of networks (128 == 27) by host-bits available for each network (16777216 == 224).

All 2097152 Class C networks, on the otherhand, have only 536870912 distinct addresses (again, 221 networks multiplied by 28 hosts).

Note that all addresses aren't necessarily usable; some of these are reserved for broadcast, some are network addresses (all zero host bits). There are also Special Use Addresses within those classes, like loopback, private network, link-local addresses and so on.

The difference in number of addresses available between Class A, B and C networks is due to leading bit prefix length (1 bit for Class A, 2 bits for Class B, 3 bits for Class C). To answer your question:

I'm understanding this as the last three bytes of IP (0.XXX.XXX.XXX) can be non unique between the 3 IP classes as long as the first byte order has a unique range where the classes don't intersect.

When considering just total number of addresses in each class you may take this one step further any say that none of the bits following the leading bit prefixes (0, 10, 110, 1110, 1111) matter. It's just number of those bits that defines number of available addresses within the class. None of the bits following the prefix need to be unique between the classes.


Of course this is even less accurate when you realize the fact that CIDR effectively replaced classful networks, as pointed out by @EJP in the comments.

Share:
13,572
lzc
Author by

lzc

Updated on June 13, 2022

Comments

  • lzc
    lzc almost 2 years

    I don't under stand this so please someone help correct my view.

    Class     First Byte Order      Number of Hosts
    A         0 - 127               256 * 256 * 256
    B         128 - 191             256 * 256
    C         192 - 223             256
    

    I don't under stand why Class B and C have less number of hosts? To me it seems that if the first byte order is defined above, then we should get roughly the following numbers of permutations for IP

    Class     Permutations
    A         128 * 256^3
    B         63 * 256^3      
    C         31 * 256^3
    

    I'm understanding this as the last three bytes of IP (0.XXX.XXX.XXX) can be non unique between the 3 IP classes as long as the first byte order has a unique range where the classes don't intersect.

    What's wrong with my understand?