How do all servers across the world ensure unique IP addresses?


I could be totally wrong here, but I’ve always been under the impression that IP addresses are unique in that for every address, there is one and only one server/computer, and viceversa. How do you accomplish this given all the different manufacturers, countries’ internet protocols, etc.?

In: Technology

That’s an awesome question. The best start of an answer is a 1 to many relationship called Nerwork Address Translation. An IP address isn’t like a fingerprint. This allows many private IP addresses to be “represented” by a smaller number of public addresses.

I will let someone else speak to ipv4 and ipv6 and how all that plays in.

It’s not actually the case. Unique addresses are required for a particular network but not for every computer there ever is. It’s like how you can’t have two cities with identical names in the same state, but two states can each have a city with the same name.

Internet Service Providers (ISPs) are the only entities capable of assigning an IP Address to a router.

ISPs themselves are each assigned their own subset of the set of all IP addresses, so that no ISP assigns the same IP address to two routers.

ISPs will assign an IP address to each customer in various ways, but the the general idea is that an IP address is “leased” and the router has to “give it back” after a certain amount of time and request a new one.

A simple strategy is to give each customer a static IP address. All leases have the same address.

However, there is a shortage of IPv4 addresses, so some providers have to rotate IP addresses between customers after each lease.

With IPv6 there are enough addresses to give every machine a static address and have billions left to spare.

In all cases, the ISP has to keep track of which IPs it has leased and which it has not.

Others have done a good job covering the basics, so I’ll go into more of the technical details.

The right to use Public IPs is assigned to companies and groups by organizations like ARIN (North America) and RIPE (Europe).

Qualifying organizations (Large companies and ISPs) apply for and pay a fee to use IP address space and are assigned blocks of unique IP addresses that they are free to use as they see fit. This address space is advertised to the rest of the internet using BGP (Border Gateway Protocol) which tells the internet where those IPs are located and how to get there.

If you attempt to advertise IP space that doesn’t belong to you (effectively stealing IPs) your peering partners (who your WAN network is connected to) will soon recognize that and filter out (block) the advertisements effectively dropping your network off the face of the internet until you fix it. This can cause serious havoc to the internet and is taken very seriously.

However the vast majority of organizations and private individuals are too small to warrant having blocks of IPs dedicated to them (the smallest issueable blocks are 256 IPs, while most companies only need 1 or 2). So instead it’s more practical for most companies and persons to effectively lease IP addresses from larger organizations (ISPs).

When you make a connection via an ISP they lease you a temporary unique IP address which is assigned to your modem. In the case of businesses (for an additional fee) a static or permanent unchanging address(es) can be assigned to the service. These addresses are unique and unchanging and therefore better suited for hosting websites and the like.

They Don’t!
Each computer or device connected to the internet does not have a unique IP address.
There are today 10+ Billion devices connected to the Internet, however the IPv4 address space is only 4.2 Billion address (because it’s a 32 bit number, so 2^32 addresses).

So how it works ??? mechanisms like NAT44(NAT) – Normal NAT(Network Address Translation) and NAT444/CGN(Carrier grade NAT) which is huge! on a large scale…allow multiple devices to use the same IP address to communicate in the Internet. I won’t go into the gruesome technical details here, but they have helped us save tremendous amount of IPv4 address space.
In fact every mobile phone Internet works through CGN, you’ll see your mobile’s IP as 100.x.x.x because that’s a special IP address range reserved for CGN servers.