Search code examples
ipv4

how many machines can actually be connected on the internet using IPV4?


Recently we were talking about IP addresses running out. I was wondering how many machines can we connect on the internet before IP addresses run out. My calculation went something like this.

Class A - 2 ^ 31 (7 bits Network Id + 24 bits Host Id.)
Class B - 2 ^ 30 (14 bits Network Id + 16 bits Host Id.)
Class C - 2 ^ 29 (21 bits Network Id + 8 bits Host Id.)
Class D - 2 ^ 28 (28 bits multicast group Id.)
Class E  - 0 Reserved for future use.

So the total number of machines that is allowed on the internet should be

2^31 + 2^30 + 2^29 + 2^28 = 2^28(1 + 2 + 4 + 8) = 15 * 2^28.

Does this calculation seem correct?


Solution

  • Technically, you can have infinite clients, but only roughly 255*255*255*243 servers. This is because a client connects to a server so the server must have a direct IP, but when a server responds, the router knows which client sent the request so it can direct it appropriately.

    So your real question is, how many SERVERS (accepting incoming connections) can you have, for which your calculation is correct.