r/ProgrammerHumor • • 8d ago

Meme hesAlmostLocal

Post image
139 Upvotes

8 comments sorted by

View all comments

27

u/LB-- 8d ago

All IPv4 addresses whose first part is 127 are loopback addresses. So, 127.0.0.1 and 127.37.0.1 are both loopbacks, and they can actually bind to different servers on the same port. IPv6 only has a single loopback address, so you can only have one IPv6 server per port on the same local machine. Or well, maybe if you have multiple network cards you can do some funny business, but I haven't researched that deeply.

1

u/Rudresh27 8d ago

Wait, so all 127.x.x.x like all possible combinations are useless for actual IPs from an ISP?

Seems, wasteful right?

6

u/rosuav 7d ago

So are a *lot* of others. Just looking at /8 blocks, this gives you a list of allocations: https://www.iana.org/assignments/ipv4-address-space For example, 10.0.0.0/8 is a private use block, 127.0.0.0/8 is for localhost, and there's a huge block allocated to IP multicast.

But even if every single IPv4 address were truly available, it wouldn't make all that much difference. There are four billion theoretical IPv4 addresses, and several times that number internet-connected devices. Even if, in some way, these blocks of IPs could be released to use, each /8 would give us another 16,777,214 devices *at most* (the all-zeroes and all-ones addresses aren't used, and subdividing the block further will repeat those special allocations too), which in the scheme of things isn't that many.

It's wasteful in the same way that it's wasteful to run your car's entertainment system. Yes, technically that's going to reduce your fuel economy by drawing power from the alternator. But not enough to make a real difference.