Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prefer IPv6 over IPv4 for connection test #27178

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

FlyGoat
Copy link

@FlyGoat FlyGoat commented Dec 1, 2023

It is almost 2024 and there is no reason to perfer IPv4 over IPv6, especially in tdesktop user still need to toggle a switch to enable IPv6.

For tdesktop's connect test, if user does not have a routable IPv6 address, onDisconnect will be called promptly to fallback to another connection. If user's IPv6 connection is somehow filtering out connection to telegram's server, it will wait until kWaitForBetterTimeout and then fallback to another connection.

This implementation is actually in spirit of happy eyeballs recommandation.

Fixes: #2198

It is almost 2024 and there is no reason to perfer IPv4 over
IPv6, especially in tdesktop user still need to toggle a switch
to enable IPv6.

For tdesktop's connect test, if user does not have a routable
IPv6 address, onDisconnect will be called promptly to fallback
to another connection. If user's IPv6 connection is somehow
filtering out connection to telegram's server, it will wait
until kWaitForBetterTimeout and then fallback to another
connection.

This implementation is actually in spirit of happy eyeballs
recommandation.

Fixes: telegramdesktop#2198
Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
@CLAassistant
Copy link

CLAassistant commented Dec 1, 2023

CLA assistant check
All committers have signed the CLA.

@FlyGoat FlyGoat changed the title Perfer IPv6 over IPv4 for connection test Prefer IPv6 over IPv4 for connection test Dec 7, 2023
@anacondaq
Copy link

It is almost 2024 and there is no reason to perfer IPv4 over IPv6, especially in tdesktop user still need to toggle a switch to enable IPv6.

It's time to wake up and smell the rotting carcass of IPv6! This so-called "next-gen" protocol is nothing but a festering heap of bugs and failures that should have been buried alongside floppy disks and dial-up internet.

Let's cut the crap and lay down the harsh reality. IPv6 is a colossal waste of time, resources, and brain cells. You think it's all rainbows and unicorns because of its supposed abundance of addresses? Think again! IPv6 is a breeding ground for vulnerabilities and headaches that make your worst nightmares look like a walk in the park.

First off, let's talk about compatibility. Ever tried setting up IPv6 on your network? Good luck with that! It's like trying to fit a square peg into a round hole while blindfolded. Sure, some devices might support it, but don't be surprised when half of your gadgets start throwing tantrums and refusing to play nice.

And don't even get me started on security. IPv6 is like leaving the front door of your house wide open and inviting hackers to come in and have a field day. It's riddled with security holes big enough to drive a truck through, and no amount of patching can plug them all.

But wait, there's more! Let's talk about performance. Ever noticed how your internet connection slows to a crawl whenever you try to use IPv6? That's because it's about as efficient as a one-legged horse trying to win the Kentucky Derby. It chews up bandwidth like it's going out of style and leaves you wondering why you bothered upgrading in the first place.

And don't even get me started on compatibility with existing tools and software. Half the time, you'll spend more hours troubleshooting compatibility issues than actually getting any work done. It's like trying to teach a fish to ride a bicycle – frustrating and utterly pointless.

So here's the bottom line: IPv6 is a dead-end technology that should have been left to rot in the annals of history. Instead of wasting our time and energy trying to salvage this sinking ship, let's stick with good old IPv4 and build upon its solid foundation. It may not be perfect, but at least it doesn't suck as hard as IPv6.

My post not about "hey, ipv4 better, and bla bla bla". No, absolutely not.
I have some experience in developing/patching/working with ipv6, this is some kind of nightmare.
You have almost zero apps on your OS that working without using any hidden pitfalls that utilize ipv6 over ipv4, and there is a reason for that. IPv6 in my personal opinion - one of the most awful network technology, and it's born dead.

Try yourself to check different things here and there:
https://github.com/search?q=ipv6+issues&type=issues

ipv6.mp4

@FlyGoat
Copy link
Author

FlyGoat commented Feb 22, 2024

@anacondaq Well, I'm doing this PR because I'm living in a place where I need to pay extra for IPv4 connection, even if I pay extra for IPv4 connection it is still worse than IPv6 one because of DS-Lite/CLAT overhead and declining IPv4 routes.

This is at least true for some parts of Europe and East Asia, all telecom infras are moving to IPv6.

I understand you don't like some design decisions made by IPv6, so do I. But we must move forward, because it's wide usage in real world had already proofed that it's not something born dead, it's the trend.

@FlyGoat
Copy link
Author

FlyGoat commented Feb 22, 2024

For this very specific use case, as we are doing connection test before actually use IPv6 connection, there is almost no chance that any regression can be introduced.

@john-preston
Copy link
Member

@FlyGoat I was told still that we really want to prefer IPv4 over IPv6 always (which means - always try to work through IPv4 if it works, use IPv6 connection otherwise).

I'd accept an experimental setting of "prefer IPv6" or even "use only IPv6" if someone PRd it, because after all that's for you, user, to decide in the end, but nothing in the normal connectivity options and certainly not by default.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Prefer IPv6 if its available
4 participants