this post was submitted on 19 Jun 2024
209 points (100.0% liked)

Programmer Humor

421 readers
2 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 2 years ago
MODERATORS
 

Today in our newest take on "older technology is better": why NAT rules!

top 50 comments
sorted by: hot top controversial new old
[–] Thiakil@aussie.zone 74 points 7 months ago (1 children)
load more comments (1 replies)
[–] azalty@jlai.lu 40 points 7 months ago (1 children)
[–] NeatNit@discuss.tchncs.de 16 points 7 months ago (4 children)

What languages use this? I don't like it!

On the other hand it goes well with >= and <=. If >= means "either > or =" then <> means "either < or >", it checks out.

But I still don't like it.

[–] RecluseRamble@lemmy.dbzer0.com 7 points 7 months ago (1 children)
[–] NeatNit@discuss.tchncs.de 4 points 7 months ago

I think Excel formulas also use this, but it's been a long time so I might be misremembering.

[–] lambalicious@lemmy.sdf.org 7 points 7 months ago (2 children)

SQL uses it but yeah, not programming language :p.

I was on mobile so I didn't have a .XCompose available to type .

[–] lud@lemm.ee 3 points 7 months ago (1 children)

I was on mobile so I didn't have a .XCompose available to type.

I feel the opposite. On mobile I have much easier access to special characters. I just need to hold down characters to get more variants.

[–] KairuByte@lemmy.dbzer0.com 2 points 7 months ago

Yup, ≠ is right “under” =. As is ≈.

[–] dan@upvote.au 2 points 7 months ago

SQL is definitely a programming language. Most dialects are Turing-complete in some way. Some allow custom functions and stored procedures.

[–] azalty@jlai.lu 2 points 7 months ago* (last edited 7 months ago)

Damn I never understood it but now it makes sense thanks to you

Yea it’s ugly 😭

[–] jh29a@lemmy.blahaj.zone 2 points 7 months ago
[–] tentacles9999@lemmynsfw.com 32 points 7 months ago (1 children)

Honestly we should just use 4 bit ip addresses, it’s too hard for me to remember ipv4 addresses anyways. Carrier grade NAT will take care of the rest.

[–] floofloof@lemmy.ca 25 points 7 months ago (1 children)

Why compromise? Use 1-bit IP addresses.

[–] WeirdAlex03@lemmy.zip 13 points 7 months ago* (last edited 7 months ago)

Finally, a use for my 1-bit bloom filter!

[–] pleb_maximus@feddit.de 30 points 7 months ago (3 children)
[–] flying_sheep@lemmy.ml 51 points 7 months ago

I haven't read anything this cursed in a while

[–] gratux@lemmy.blahaj.zone 22 points 7 months ago* (last edited 7 months ago) (2 children)

Yes, but why would you want to? We have enough addresses for the foreseeable future.

[–] jlh@lemmy.jlh.name 8 points 7 months ago* (last edited 7 months ago) (1 children)

1:1 stateless NAT is useful for static IPs. Since all your addresses are otherwise global, if you need to switch providers or give up your /64, then you'll need to re-address your static addresses. Instead, you can give your machines static private IPs, and just translate the prefix when going through NAT. It's a lot less horrible than IPv4 NAT since there's no connection tracking needed.

This is something I probably should have done setting up my home Kubernetes cluster. My current IPv6 prefix is from Hurricane Electric, and if my ISP ever gives me a real IPv6 prefix, I will have to delete the entire cluster and recreate it with the new prefix.

[–] Thiakil@aussie.zone 4 points 7 months ago (6 children)

It should only be needed if your ISP is brain-dead and only gives you a /64 instead of what they should be doing and also giving you a /56 or /48 with prefix delegation (I.e it should be getting both a 64 for the wan interface, and a delegation for routing)

You router should be using that prefix and sticking just a /64 on the lan interface which it advertises appropriately (and you can route the others as you please)

Internal ipv6 should be using site-local ipv6, and if they have internet access they would have both addresses.

[–] LaggyKar@programming.dev 2 points 7 months ago* (last edited 7 months ago) (1 children)

64 for the wan interface

Nitpicking, but the address for the wan interface wouldn't have a prefix, so the host would just set it as a /128 (point-to-point)

load more comments (1 replies)
[–] dan@upvote.au 1 points 7 months ago* (last edited 7 months ago) (5 children)

My ISP does this right (provides a /56 for routing), but unfortunately both are dynamic and change periodically. Every time I disconnect and reconnect from the internet, I get a different prefix.

I ended up needing to have ULAs for devices where I need to know the IPv6 address on my network (e.g. my internal DNS servers).

load more comments (5 replies)
[–] jlh@lemmy.jlh.name 1 points 7 months ago* (last edited 7 months ago) (1 children)

Hurricane Electric gives me a /48.

Site-local ipv6 would work here as well, true. But then my containers wouldnt have internet access. Kubernetes containers use Ipam with a single subnet, they can't use SLAAC.

[–] Thiakil@aussie.zone 1 points 7 months ago (1 children)

Point is, you should be able to have them have both. Or stick a reverse proxy in front that can translate. Unless they're somehow meant to be directly internet reachable the public addresses could be autogenerated

Full disclosure though I don't know anything about kubernetes.

[–] jlh@lemmy.jlh.name 1 points 7 months ago (1 children)

Yeah, I wonder if there's any proposals to allow for multiple IPV6 addresses in Kubernetes, it would be a much better solution than NAT.

As far as I know, it's currently not possible. Every container/Pod receives a single IPv4 and/or IPv6 address on creation from the networking driver.

[–] Thiakil@aussie.zone 2 points 7 months ago (2 children)

Even if you give it multiple ip6 cidrs to allocate?

load more comments (2 replies)
load more comments (3 replies)
[–] lambalicious@lemmy.sdf.org 2 points 7 months ago

That's what they thought for IPv4... and for 2-year digits... and for...

[–] r00ty@kbin.life 8 points 7 months ago

Only if you're a masochist.

[–] missphant@lemmy.blahaj.zone 25 points 7 months ago (2 children)

Ha I can remember the ipv6 of cloudflare DNS just fine! It's uh..... something : something : something :: 1111

[–] Morphit@feddit.uk 7 points 7 months ago* (last edited 7 months ago) (9 children)

2606:4700:4700::1111

Hmm, maybe Google is easier:
2001:4860:4860::8888

Quad9 is 2620:fe::fe or 2620:fe::9

I don't understand why they can't get better addresses than that. Like surely 1::1 would be valid?

Edit: So IANA only control addresses 2001:: and up and there are quite a few IETF reservations within that. I don't know why they picked such a high number to start at. Everything else seems IETF reserved with a little space allocated for special purposes (link-local, multicast, etc.).

load more comments (9 replies)
load more comments (1 replies)
[–] PlexSheep@infosec.pub 21 points 7 months ago (3 children)

Ipv6 is not 6 bytes? 8 segments of 2 bytes for a sum of 16 bytes?

Or am I stupid right now?

[–] NeatNit@discuss.tchncs.de 4 points 7 months ago (1 children)

Yes, you've got it right. <> means ≠. 16 is not equal to 6.

[–] PlexSheep@infosec.pub 2 points 7 months ago

Never seen that Notation.

[–] lambalicious@lemmy.sdf.org 2 points 7 months ago (2 children)

IPv6 is unfortunately not six bytes, no. For some weird, ass-backwards reason.

[–] purplemonkeymad@programming.dev 5 points 7 months ago (1 children)

Because 48 bits over 32 bits does not really solve the problems with ip4. 128 bits basically gives one ip4 address space to each square meter of earth. Ip6 also drops all the unused and silly parts of ip4 too.

load more comments (1 replies)
load more comments (1 replies)
[–] awesome_lowlander@lemmy.dbzer0.com 2 points 7 months ago* (last edited 7 months ago) (1 children)

~~2 bytes would give you 0-4 per segment. Or about IPv2~~

[–] jjagaimo@lemmy.ca 4 points 7 months ago* (last edited 7 months ago) (1 children)

2 bytes would be 0-65535 and 8 sets is ~3.4×10^(38) addresses

Whoops, bits vs bytes. This is why I should stop commenting before I've had coffee

[–] deezbutts@lemm.ee 20 points 7 months ago

Mystery of the universe, would IPv5 have hit the sweet spot and taken off?

[–] mox@lemmy.sdf.org 18 points 7 months ago* (last edited 7 months ago)

6 ≠ 16
v ≠ o

[–] SpaceCadet@feddit.nl 17 points 7 months ago* (last edited 7 months ago) (1 children)

IPv6 = second system effect. It's way too complicated for what was needed and this complexity hinders its adoption. We don't need 100 ip addresses for every atom on the earth's surface and we never will.

They should have just added an octet to IPv4 and be done with it.

load more comments (1 replies)
[–] sundray@lemmus.org 5 points 7 months ago

Well... I still like IPv6 better than ATM and those darn virtual circuit identifiers.

load more comments
view more: next ›