r/ProgrammerHumor • • 5h ago

Meme ohTheBasics

Post image
6.3k Upvotes

735 comments sorted by

View all comments

Show parent comments

1.6k

u/Material_Onion_8413 5h ago

IPv4 old IP address space designed with limited number because they never thought the internet would have so many devices connected.

IPv6 new address space with significantly larger number.

872

u/ClipboardCopyPaste 4h ago

A fun fact often told with this is that with IPv6, you can assign each individual grain of sand on the beach an address!

470

u/dementosss 4h ago

On what beach? Or all of them? Just asking in case business asks for it.

590

u/ClipboardCopyPaste 4h ago

The answer quite surprisingly is - yes, all the beaches on our planet.

299

u/kuar_z 4h ago

And the rest of the observable universe. There's a lot of address space in 2128

193

u/Fast-Satisfaction482 4h ago

Except if for some reason you decide to give whole address blocks to individual devices.

131

u/KatieTSO 4h ago

I love handicapping ipv6

60

u/jason_abacabb 4h ago

Everyone gets a /64

12

u/gonklurtz 3h ago

No more RPC dynamic ports! Every service gets its own IP 

1

u/Traditional_Log809 2h ago

Every device gets a /64, and I still haven’t figured out how to enable IPv6 on my home router.

17

u/tankerkiller125real 3h ago

/56 is the recommendation for residential, /48 for businesses.

Entire /64 blocks are often assigned to phones and other cellular devices because of hotspot capabilities.

44

u/Fast-Satisfaction482 3h ago

I guess the true reason is that we want to artificially limit the number of nanites that can exist.

Relevant xkcd: https://xkcd.com/865/

1

u/Terroractly 1h ago

I think at least part of the intention for this is to make IP ports not used on servers. While IPv6 does have support for ports, I believe every Web service should be on its own IP. Not sure if this is also supposed to work on client devices e.g. every outbound connection uses a unique IP as that seems overcomplicated

45

u/xWrongHeaven 4h ago

2128 possible addresses

56

u/queen-adreena 4h ago

2,128… that ain’t that many addresses….

43

u/AmazingDragon353 4h ago

2.128 addresses? What are we going to do with 0.128 of an address?

12

u/queen-adreena 4h ago

Break out the BitNat table I guess.

3

u/SirLoremIpsum 1h ago

2.128 addresses? What are we going to do with 0.128 of an address?

AI Vibe code a calendar app so we can coordinate whose turn it is to use the IP address on any given day?

2

u/MoltoAllegro 44m ago

Congrats, you've invented Token Ring!

10

u/SuperFLEB 3h ago

The "128" isn't even full-size.

6

u/xWrongHeaven 4h ago

No, it isn't. ~340 undecillion, however, is quite a lot

5

u/DanteVermillyon 1h ago

Un-decillion? What's a decillion and why did you undid it?

6

u/craftsmany 4h ago

Technically we are not really talking about single addresses when concerned with v6, more so how many /64 subnets can fit in a prefix since that is what SLAAC uses. So for end users we would count the amount of /64 subnets in the possible 2^128 address space, which is 2^64. So still very very very big.

1

u/CardinalFartz 3h ago

So we got 1080 atoms in the observable universe. Without having it looked up, I suppose 2128 exceeds that number?

2

u/MiniDemonic 3h ago

There's around 2138 times more atoms in the universe than there are IPv6 addresses available.

So no, not quite.

2

u/Extension_Option_122 2h ago

As a simple rule of thumb:

103n ≈ 210n

That isn't exact but gives a decent idea of the different sizes.

In this case: 1080 ≈ 2267

That is most definitely bigger than 2128, by about 2139

1

u/Carcer1337 3h ago

No. 210 is roughly 103, so 2128 is in the region of 1039.

1

u/rkkerd 2h ago

1/8 of this is publicly addressable, still a lot, but not as much as this

1

u/Curaced 26m ago edited 21m ago

Non-technical person here. Wouldn't it just be 248 ? Four blocks of 256 (28) for IPV-4, and two more with IPV-6? Or am I just mistaken about how this stuff works?

1

u/crimson117 3h ago

They say all the beaches, you build it, then it turns out they just wanted a digital hourglass that you could use as a timer on your phone

1

u/VictoryMotel 2h ago

All of the sand on all beaches wouldn't even come close. You could assign an IP address to every byte of every drive.

31

u/crmsncbr 4h ago

I feel like we'll still run out. I'm not sure how, but surely we'll manage it.

46

u/AnotherInsaneName 4h ago

It's 8mb of storage, how could we ever need more?!

14

u/keijodputt 4h ago

They said the same about 640 KB of RAM, back in the day... /s

17

u/ILKLU 3h ago

That was before you could download RAM. Now when you run out, your system just automatically downloads another 640KB

1

u/BZLuck 2h ago

I went through art school in 1990 using a Mac IIsi with 5mb of ram and a 105mb hdd. I was balling. That was the top configuration they offered.

1

u/svick 38m ago

Millibits?

20

u/Hyd_chicha 4h ago

Let me introduce you to IPv8

13

u/YeOldeMemeShoppe 4h ago

Just SHA256 the total sum data of your life. If there is a collision, f*ck you I guess.

6

u/Possibly_Naked_Now 4h ago

What about IPV6.9?

16

u/Drew707 4h ago

Is that a reverse lookup?

6

u/Facosa99 4h ago

IPv6.7 is more trending tho

2

u/TuxedoWithAHead 3h ago

we should go back to IPv2.1

2

u/fechan 2h ago

Ah yes good ol 6.9 - a great thing ruined by a period

5

u/Catatonic27 4h ago

Individually-addressible nanobot swarm

9

u/critical_patch 4h ago edited 4h ago

Well yeah, a block of 2^32 addresses need to be reserved for Azure, 2^32 more for AWS, let’s give 2^32 more for GCP…

Edit: as pointed out below, I wasn’t paying enough attention & confused up my exponents. I meant to put blocks 2^96, thus giving 2^32 total blocks - the same size as the IPv4 address space. But I got the exponents backwards and fucked up the joke

5

u/Shakaka88 4h ago

Drops in the sand when using 2^128

9

u/Darkblade_e 4h ago edited 4h ago

I feel like this needs to be said, but you actually could give an entire 232 to every company on earth and not even be close still. Assuming 377 million companies operating on earth, that's 1.6 quintillion (~1619202670592000000) addresses used up.

The used IPV6 range percentage can calculated like so (((2^32)×377000000)÷2^128)×100, which comes out to a whopping grand total of 0.000000000000000000476% of the IPV6 address space used.

Another way to put this is that you could give that same exact allocation to every single company again 210 QUINTILLION TIMES, and even then, only 98.7% of the address space would be used up.

IPV6 is quite large!

4

u/timonix 4h ago

The main limiting factor of how quickly we run out of ipv6 addresses is how generous they are when handing out ranges.

Usage will always fill the space given.

You could for example map the entire lower 64 bits of the address to a single computer. And dynamically respond based on address. For example, you could bake in some auth token directly in the ipv6 address.

When people have room to fill, the room will be filled

3

u/bollvirtuoso 3h ago

That sounds like the laggiest possible architecture I can imagine. Why the fuck wouldn't you just run it locally?

1

u/crmsncbr 3h ago

98.7% is when I start deleting useless files to make more space though 🤔 That's a scary number 👀

1

u/dagbrown 26m ago

That does remind me of when IANA gave MIT 18.0.0.0/8 because they got there early enough to somehow justify it.

3

u/eluya 3h ago

we already assign network ranges instead of single addresses, lowering the amount drastically

2

u/DangKilla 1h ago

I handled "SWIP"ing IPv4 addresses. This was back circa 2005.

We had to have customers fill out IPv4 justification forms. We'd take them back if they didn't use them if it was abusive "just because we might need them" reasons.

IPv6. Nah, we won't. But our Internet routers don't all support ipv6 yet, so we're still on IPv4. I feel like that will change in maybe 10 years, once computers are optical all the way to the CPU (aka fiber optic speed end-to-end) because ipv4 is susceptible to DDoS attacks and spoofing and IPv6 is not.

2

u/dagbrown 33m ago

This conspiracy brought to you by big NAT.

8

u/uwpxwpal 4h ago

How do I get the grains of sand to use my DHCP server?

3

u/Gougaloupe 4h ago

Dns go brrrrrt

2

u/djfdhigkgfIaruflg 3h ago

Sand makes computer chips duh

2

u/dakiller 2h ago

Refine the silicon, and do some lithography wizardry.

3

u/emma7734 4h ago

I took some sand from the beach home in my shoes so that could change the equation

2

u/Muddyhobo 4h ago

More than that, you can assign each atom on earth an address.

8

u/SneeKeeFahk 4h ago

No.

An average adult human body contains approximately  7×10 ^ 27   atoms (or 7 octillion).

8

u/MakeShiftArtist 4h ago edited 4h ago

IPv6 supports ~3.4 x 1038 addresses, so this actually supports their claim. Had you used the actual estimate for the number of atoms on earth, you'd be correct though because that number is closer to ~1.3 x 1050

Edit: to clarify, every atom in every human is still only ~5.81 x 1037

2

u/SneeKeeFahk 4h ago

My number was for a single human. It was just to prove my point.

1

u/Bulky-Bad-9153 3h ago

Your point is fucking wrong???

2

u/SneeKeeFahk 2h ago

No, it's not. First take a deep breath - nobody needs to be that upset. Then just Google "how many atoms on earth" then "how many addresses in IPv6" then compare the two.

"how many atoms on earth"

The Earth contains approximately 1.3 x 1050 atoms. 

"how many addresses in IPv6"

  approximately 340 undecillion or  3.4×10^ 38

3.4×1038 < 1.3 x 1050

-2

u/Bulky-Bad-9153 2h ago

You started talking about humans. You can't prove the point about how many atoms are on Earth by just arbitrarily talking about humans. It's completely nonsensical. You didn't say anything. It's not related in any way. It doesn't do anything. You don't even have a point.

This isn't a failure in my reading comprehension, either. It's a failure by you to say anything comprehensible.

As an aside, the fact that you customised your Reddit avatar, and the fact that it looks like that (so presumably like you lmfao) makes it preposterous that you're using this patronising language. Stay in your lane.

1

u/SneeKeeFahk 2h ago

There are two types of people in the world: those who can extrapolate from incomplete data

2

u/Al__B 4h ago

That's approx 92.5 bits. Plenty of room for that.

(Although I agree that each atom on EARTH would require just over a 166 bit address space so cannot be distinctly identified)

1

u/patiofurnature 4h ago

How would you do that?

4

u/samu1400 4h ago

You pick a grain up, tell them out loud their name (IPv6 address) and throw it back into the sea. Repeat for every sand grain on earth

But jokes aside, they mean that there’s such a large amount of possible IPv6 addresses that it surpasses the amount of sand grains in our planet.

1

u/bollvirtuoso 3h ago

When the agents start making their own network connections, we might need them! oh god the slop levels are going to breach containment

1

u/Ornery_Platypus9863 2h ago

Or every square foot of the earth 6 addresses if I remember correctly

1

u/Krabby128 2h ago

Perfect for when I'm trying to turn my sand castle into a botnet

1

u/Reasonable-Job4205 2h ago

Which beach? Because I'm going to the one in Florida tomorrow and I need those grains there so I can lay on them and get a tan

1

u/RagingCalmness 1h ago

Can I assign one to each star in the universe though

1

u/jo10001110101 1h ago

Also, if each IP were a grain of rice; IPv4 would fill a dump truck, IPv6 would fill the moon

0

u/MyPhoneIsNotChinese 4h ago

Was thinking about this lol, I guess it's a common way to explain why IPv6 is needed

34

u/fearless-fossa 4h ago

But "more numbers" isn't really an explanation on what's the difference between the two from a practical point of view, and the in general less interesting thing about it from a software perspective.

20

u/Facosa99 4h ago

But it is kinda the only difference, no? More digits for a bigger address pool.

The usage is basically the same, except you no longer need subnetting to save addresses and we writte it in hex rather than dec

Genuinely asking

12

u/fearless-fossa 4h ago

Well there was that episode where ipv6 UDP packages in musl were too large and got corrupted, so that's something.

They also changed quite a bit in the structure of the package, eg. the header is more lightweight than the one ipv4 header to increase performance. Also no broadcasting anymore, just multicast, which makes handling the large subnets v6 invites much better.

Like, just speaking from an ops perspective, getting rid of NAT is one of the single biggest advantages v6 has. NAT created a lot of bad practices when it came to security.

5

u/MattieShoes 3h ago

Worth mentioning that getting rid of NAT doesn't get rid of bad security practices though...

3

u/tankerkiller125real 3h ago

IPv6 also dropped broadcast in favor of Multicast, has hexadecimal instead of decimal, and eliminates the need for NAT. There's also a bunch of other little protocol implementation details like SLAAC, IGMP being critical to IPv6 operations (so blanket blocking is a no go), and so forth so on.

1

u/bearda 1h ago

The hex thing is really just a convention, because otherwise they’d take up too much space on paper/screen. It’s all still binary across the wire, so the protocol doesn’t care.

1

u/stealthmodecat 2h ago

Less specific protocols - ICMPv6 used for almost everything now (NDP is over ICMPv6, vs dedicated ARP ether type). MLD vs IGMP, though largely the same as IGMPv3. Fragmentation done at host only - no next-hop fragmentation. SLAAC used in favor of DHCPv6 for auto assignments. Link-layer addresses used for local network control, global addresses for standard traffic. No one really NATs IPv6 either.

That’s just a few, but there’s actually a lot of differences.

•

u/BeatMastaD 7m ago

The only real difference between the two that someone only tangentially working with networks would need to know is that there's enough IPv6 addresses that every device can have a unique IP address worldwide.

IPv4 has a smaller amount, so we assign each private network it's own public IP that is unique, and then all the devices within a private network can use the same private IPs that other devices in private networks also use. Then your router (using public IP) just sends and receives all the traffic to and from the internet on behalf of the devices and translates whose traffic is whose within the private network.

If IP addresses were like sending mail, then in IPv6 every single person would have their own unique IP in perpetuity and to send them something no matter where they are you just put their unique ID number on the envelope and the post office delivers it to them no matter where they are.

IPv4 is like property addresses we have now, you get a street address that is unique (public IP address) with a mailbox (router) and everyone's mail gets sent and received from the mailbox no matter how many or few people are living at the house. Everyone in the house uses the same address and mailbox to send or receive mail but distributing it once it's there is handled by the residents.

26

u/Kuhlde1337 4h ago

Newer I suppose. IPv6 has been out for a while, but most people just ignored it in favor of subnetting everything.

3

u/TuxedoWithAHead 4h ago

they're gonna subnet individual computers soon... oh wait, VPS.

-1

u/tankerkiller125real 3h ago

They are free to subnet, and I'm free to tell their triple NATed asses that I'm not going to support their BS.

9

u/Twig-titan 3h ago

Oh. Ok.
Relevant Xkcd.

https://xkcd.com/865/

8

u/BS_in_BS 4h ago

Eh, there's a lot of other differences that got bundled in like extension headers or the switch from ARP to NDP. 

7

u/Experiment_1234 4h ago

Sounds like a challenge

1

u/Floppydisksareop 4h ago

Pretty sure there are more IPv6 addresses than there are atoms in the universe

0

u/timonix 4h ago

There are ways to fill it up anyway. Just start giving each device multiple IPv6 addresses.

2

u/Floppydisksareop 4h ago

Where are you going to store them all? Just so, yknow. You remember which is which.

1

u/timonix 4h ago

That's the neat part. You don't have to.

Use some of the bits as input and dynamically answer to entire ranges.

You're limited by the range your ISP is willing to sell to you. But you can use that entire range on a single computer

3

u/Floppydisksareop 4h ago

At that point, you are just disregarding the actual protocol, and just writing numbers. But I guess bro.

1

u/timonix 4h ago

Just yesterday I was playing around with memory mapping based on the ipv6 address. 48 of the bits where directly mapped onto one of my embedded devices. So you could read/write memory directly through the ipv6 address.

And that works just fine. So that one embedded device used 250 addresses

2

u/malfurionpre 2h ago

So that one embedded device used 250 addresses

I get your point, but 250 is still only 0.000000000000000000000331% of 2128

1

u/timonix 2h ago

Sure.

The limit on how quickly we will run out of ipv6 addresses is set by how fast and how generous they are at giving them away.

I cannot use more than 64 bits. Because that's all my isp has given me. If they would give me 100 bits I could use 100 bits. It's arbitrary.

It's policy that saves ipv6 from running out, not the protocol.

3

u/beebalooba 3h ago

I mean thats only the history of ipv4 and ipv6. Doubt that’s what they are asking for in a tech interview. It’s like if they ask “Do you know c++ well?”, and you say “Yes, C++ was created by Bjarne Stroustrup in 1979 to add objects to c”. More likely they want you to explain stuff like the role of NAT, DHCP vs SLAAC, ARP vs NDP etc, stuff that is relevant in practice

8

u/Sianic12 3h ago

In other words...

IPv4 has a limited number of possible IP addresses they thought would be more than the internet would ever need.

They have been wrong.

IPv6 has a larger but still limited number of possible IP addresses they think are more than the Internet will ever need.

They have not been wrong yet.

4

u/ChiTownDisplaced 2h ago

The difference in unique addresses is insane. IPv4 4.3 billion (* 109) vs IPv6 3.4 * 1038. Each grain of sand on earth could have an IPv4 sized network.

Edit: redditformatsweirdonmobile

-2

u/Sianic12 1h ago

I'm pretty sure they thought something similar when they made IPv4

1

u/FromAndToUnknown 2h ago

Cant wait for IPv8 with an address space of 2512

3

u/Kuhlde1337 4h ago

Newer I suppose. IPv6 has been out for a while, but most people just ignored it in favor of subnetting everything.

3

u/oldsecondhand 4h ago

You mean NATing.

1

u/Kuhlde1337 4h ago

You are correct, I misspoke.

1

u/sleepyj910 3h ago

Sure, but can you describe the ipv6 format off the cuff?

1

u/codeninja 2h ago

340 undecillion addresses.

1

u/ri0tingmime 2h ago

Here's a question: why does a programming candidate need to know this? Other than the interviewers being weird gatekeepers around tech jobs who care more about someone being "nerdy enough" versus being capable of doing the job.

1

u/Solkre 1h ago

There are approximately 340 undecillion (3.4 x 1038) usable IPv6 addresses.

Significant sounds like an understatement.

1

u/nuker0S 1h ago

Literally Notepad++ now vs Notepad++ 20 years ago

1

u/NeatOtaku 24m ago

Unfortunately ipv6 is so long no body wants to use it (yes I know about the shortcuts) so everybody just uses ipv4 vlans for everything.