How many hosts can 100 IPs serve?

How many hosts can 100 IPs serve?

I have calculated this once in an old article, but the algorithm I used at the time was too conservative, so I decided to give my answer again in this article.

To simplify the problem, only one layer of NAT is allowed here. Nested NAT is not allowed, and IP does not distinguish between public and private.

In the old article, I divided the 100 IPs into two equal parts. One part of 50 IPs was used as the intranet IPs, and the other part of 50 IPs was used as the router IPs of each subnet. So the calculation result was 49 times 49 = 2401, which is more than 24 times the number of hosts that can be served when 100 IPs are directly allocated (the old article did not take into account the IP consumed by the gateway, and used 50 times 50 for calculation, which is corrected here to 49 times 49).

picture

Looking back now, I was too cautious at that time. Since NAT is used, there is no need to worry about conflicts caused by duplicate IP addresses not only between brother subnets, but also between internal and external subnets.

The NAT service connects different subnets like a "wormhole". No matter whether they are brothers or parents, they will not affect each other. The subnets are like "parallel universes".

There are still 100 IPs, but with one layer of NAT, one IP is used as the default gateway address, and the other 99 IPs are allocated to hosts. The maximum number of hosts that can be served is actually 99 times 99, which is 98 times the scale of directly using 100 IPs.

picture

We have been emphasizing that NAT should not be used in a nested manner because the nested use of NAT will form a tree structure with increasingly higher levels.

The non-leaf nodes of this tree can be regarded as network devices such as routers, and the leaf nodes are connected hosts. As a full tree, the leaf nodes at the bottom of the tree will increase exponentially as the height of the tree increases.

picture

Based on this, if the level of NAT nesting is not limited, the number of hosts that 100 IPs can serve is theoretically unlimited.

But this is inevitably confusing. Isn’t IPv4 not enough? According to this article, 100 IPs can serve unlimited hosts by nesting NAT. So what is the point of IPv6?

In addition, many explanations about the significance of the existence of private IPs say that it is to solve the problem of insufficient IPv4. However, from this article, it seems that there is no need to distinguish between private IPs and the problem can be solved by simply using NAT. So what is the significance of dividing up private IPs?

The above two questions are exactly what I want to continue answering. In order to avoid the article being bloated and tedious, I will leave them for separate answers later.

<<:  Do you know several commonly used communication methods in microservices?

>>:  Qianxinan Prefecture: Green "optical" network, a new style of government office

Recommend

One cannot miss the key points of future data center development

Where will the data center of the future go? I be...

What else does a smart city need besides technology?

There are questions that need to be answered abou...

Google acquires the developer of Job Simulator and plans to develop VR content

Today, Google announced that it has acquired Owlc...

...

5G is here: Will 4G soon be relegated to the sidelines?

Will 4G, which once brought prosperity to the mob...

In addition to speed, 5G can also change these aspects of your life!

5G is the hottest buzzword at the moment, and it ...