I used to think something was genuinely broken about the internet.
Every device in my house showed an IP like 192.168.1.2 or 192.168.1.5. Fine, maybe that’s just how my router works. But then I checked my friend’s laptop — same pattern. Then at my office. Then at a café.
At some point, I had to stop and ask: if literally everyone on the planet is using 192.168.x.x, how is there no conflict? How is anything working at all?
Turns out I had a pretty fundamental misunderstanding. And fixing it was one of those moments where you feel slightly stupid and slightly relieved at the same time.
Press enter or click to view image in full size
Anyways. Let’s get into it.
Not all IP addresses are meant for the internet. That was the thing I was missing.
There are public IPs — globally unique, assigned by your ISP, what the internet actually sees when you make a request. And then there are private IPs, which only exist inside local networks. Your home WiFi, your office, that café you’re pretending to work from — each one is running its own isolated little world, invisible to the outside.
The 192.168.x.x addresses are private. They never leave your router.
So what happens when you actually need to reach the internet? Your router steps in and does something called NAT — Network Address Translation. When your phone sends a request outward, the router swaps your private IP (say, 192.168.1.3) with its own public IP (something like 49.x.x.x), makes the request on your behalf, and when the response comes back, routes it to the right device. It’s basically acting as a receptionist.
One public face. Everyone behind it is invisible.
This is also why there’s no conflict between your home network and someone in another country using the exact same IP range. The networks are completely isolated. Private IPs don’t need to be globally unique — they just need to be unique inside their own network.
The analogy that made this click for me: room names inside a house. Every house has a bedroom and a kitchen. No conflict, because they’re in different buildings. Private IPs are room names. Public IPs are your street address — that one actually has to be unique, otherwise nothing reaches the right place.
There are only three official private IP ranges: 192.168.0.0–192.168.255.255, 10.0.0.0–10.255.255.255, and 172.16.0.0–172.31.255.255. That's it. The entire world reuses them constantly, and it works fine, because isolation handles everything.
Public IPs though — different story. IPv4 only supports around 4.3 billion addresses, and we’ve basically exhausted them. ISPs have been doing tricks like sharing one public IP across multiple users to stretch things out. That’s also why IPv6 exists — the address space is so large we probably won’t run out in our lifetime. Probably.
Okay, now here’s where it gets a little nerdy. But stick with me — I promise this part is actually satisfying.
We talked about how devices on the same network can talk to each other. But here’s a question nobody really asks out loud: how does the router actually know which devices are “inside” the same network? What’s the rule?
The answer is subnets.
Let’s take two devices:
192.168.1.67192.168.1.200Both are 192.168.1.something — so they're on the same network, right? Maybe. Depends on the subnet mask. Which is a sentence that probably means nothing to you right now, but give it two minutes.
Writing IPs in binary
Join Medium for free to get updates from this writer.
Every IP address is four numbers, and each number can be written in binary. You don’t need to memorise any of this — just follow the shape of it:
IP A → 192.168.1.67 → 11000000.10101000.00000001.01000011
IP B → 192.168.1.200 → 11000000.10101000.00000001.11001000They look almost identical. The first three chunks are the same. Where they differ is that last part — 01000011 vs 11001000. Hold that thought.
The subnet mask
You’ve probably seen /24 written next to an IP and quietly ignored it. That's the subnet mask. It tells you how many bits are "fixed" — how much of the address defines the network versus the individual device.
/24 = first 24 bits are fixed = 255.255.255.0/25 = first 25 bits are fixed = 255.255.255.128In binary:
/24 → 11111111.11111111.11111111.00000000
/25 → 11111111.11111111.11111111.10000000One extra bit. Doesn’t sound like much. Watch what it does.
The actual check — bitwise AND
Here’s the move. You take each IP and AND it with the subnet mask. The rule is dead simple: 1 AND 1 = 1, everything else = 0. Whatever comes out is the network address. If both devices produce the same network address — same subnet. If not — strangers.
With /24:
IP A: 11000000.10101000.00000001.01000011
Mask: 11111111.11111111.11111111.00000000
------------------------------------
Result:11000000.10101000.00000001.00000000 → 192.168.1.0 IP B: 11000000.10101000.00000001.11001000
Mask: 11111111.11111111.11111111.00000000
------------------------------------
Result:11000000.10101000.00000001.00000000 → 192.168.1.0 Same result. Both land on 192.168.1.0. They're on the same subnet. Same lunch table.
Now try /25:
IP A: 11000000.10101000.00000001.01000011
Mask: 11111111.11111111.11111111.10000000
------------------------------------
Result:11000000.10101000.00000001.00000000 → 192.168.1.0IP B: 11000000.10101000.00000001.11001000
Mask: 11111111.11111111.11111111.10000000
------------------------------------
Result:11000000.10101000.00000001.10000000 → 192.168.1.128Different. 192.168.1.0 vs 192.168.1.128. Different subnets.
Same two devices. Same IP range. One subnet mask says they’re neighbours, the other says they’re in completely separate networks. That one extra bit splits the whole network in half — .1 to .127 on one side, .128 to .255 on the other. IP B sits at .200, which puts it firmly on the wrong side of the line.
It’s a bit like being assigned to a different team just because your birthday falls one day past some arbitrary cutoff. Except here the cutoff is enforced by binary math, and there’s no HR department to complain to.
So that’s it, really.
Private IPs like 192.168.x.x are not unique globally — they're designed to work inside local networks and get reused everywhere without conflict.
Routers use NAT to connect these private networks to the internet through a single public IP. And subnets are how the network decides which devices can actually talk to each other directly.
Once this clicked for me, a lot of other networking stuff started making more sense. Not all of it. But enough to feel less lost.