ValveSoftware / steam-for-linux

Issue tracking for the Steam for Linux beta client
4.23k stars 174 forks source link

Steam doesn't work on IPv6-only (NAT64/DNS64) networks #3372

Open oerdnj opened 10 years ago

oerdnj commented 10 years ago

I understand that my request might look like coming from Mars :), but there's an issue in the official steam client using a way to connect to steam servers the is not Internet Protocol compatible. (Yeah, I am not speaking about legacy IP ;)).

I am running on IPv6-only + NAT64/DNS64 network and Steam fails to connect to the servers although the connectivity works as expected - the IPv4 gets remapped to IPv6 addresses, so every application should not notice the difference unless:

a) you use some strange/ancient API to connect to TCP sockets b) you use IP addresses instead of domain names to connect to steam servers

The fix is obvious:

a) add native support for IPv6 into steam and prefer IPv6 if found b) use DNS to resolve the names of steam servers or have IPv6 address that gets used when IPv6 is detected.

I do not expect this to be solved quickly, but a record in internal tracker with some future fix would be nice.

DNS64 example:

$ dig IN AAAA store.steampowered.com @2001:1488:fffe:20::34

; <<>> DiG 9.9.5-4-Ubuntu <<>> IN AAAA store.steampowered.com @2001:1488:fffe:20::34
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 64038
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 6, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;store.steampowered.com.        IN  AAAA

;; ANSWER SECTION:
store.steampowered.com. 5   IN  AAAA    2001:1488:fffe:30:ffff:ffff:173f:40c0

;; AUTHORITY SECTION:
steampowered.com.   9320    IN  NS  a8-66.akam.net.
steampowered.com.   9320    IN  NS  a24-64.akam.net.
steampowered.com.   9320    IN  NS  a1-164.akam.net.
steampowered.com.   9320    IN  NS  a11-67.akam.net.
steampowered.com.   9320    IN  NS  a26-65.akam.net.
steampowered.com.   9320    IN  NS  a9-67.akam.net.

;; Query time: 1 msec
;; SERVER: 2001:1488:fffe:20::34#53(2001:1488:fffe:20::34)
;; WHEN: Mon Jun 23 10:08:09 CEST 2014
;; MSG SIZE  rcvd: 211
palaughton commented 3 years ago

It's also not like NAT64/DNS64 networks are a new thing.

Nivex is right; it's been 10 or more years since I started setting up IPv6-only networks with NAT64.

palaughton commented 3 years ago

Edit: yes, I am taken aback by how little Valve does to fix this relatively severe issue, considering that the IPv6 RFC was released in 1998.

Only if you consider RFC2460 to be the start of it; there's also RFC1883 from December 1995.

(It should probably be vaguely concerning that I cited all of the above without looking them up. 😬)

karatekid430 commented 3 years ago

This "Valve" is clearly defective; no action in seven years. Get onto modern software engineering practices and stop using legacy APIs. Please.

rawhide-kobayashi commented 3 years ago

Gonna have a bad time if starlink ends up going huge and still has to use CGNAT for IPV4...

SirStoneyBologna commented 3 years ago

Gonna have a bad time if starlink ends up going huge and still has to use CGNAT for IPV4...

I laughed when reading this. I am using Starlink and have been bummed I can't get my dedicated server going behind the cgnat. They just allowed ipv6 but everything is so outdated you can't host a dedicated server on ipv6. Frustrating...

Strykar commented 3 years ago

Good god man, my new FTTH ISP is IPv6 only, please get IPv6 going, it's mid 2021!

myxal commented 3 years ago

China comes to rescue: https://www.theregister.com/2021/07/26/china_single_stack_ipv6_notice/

By the end of 2023, new networks won't be allowed to use IPv4 – a change that signals progress in China's vision of a single IPv6 networking stack for the nation.

Hard to tell what new networks they actually mean here - if residential networks are included, this may become Valve's deadline.

booth-f commented 3 years ago

9/25/21 - NAT64/DNS64 - Steam Client cannot connect

Valve, it's very simple to fix. Please update the Steam client to not use hardcoded IPv4 addresses. This is not hard. All somebody needs to do is change the Steam Logon IPs to hostnames and point them to A records in DNS. There is no need to supply your own AAAA records unless you actually support native IPv6 connectvity. All we are asking is for basic DNS64/NAT64 support on networks that are IPv6-only.

I have a very small list of services that aren't reachable via the NAT64/DNS64 method and Steam is right there at the top of my list.

benaryorg commented 3 years ago

This is very likely not a DNS issue.

I'd very much like to get this out of the way, since most people complain about it being a matter of hardcoded IP addresses, which in all likelihood isn't the real issue. Complaining in this issue does pretty much nothing to solve the problem, as Valve almost certainly doesn't get constant notifications for this thread. If you want things to change then please bother them directly as I've mentioned before, or provide constructive feedback, in terms of debugging results.

What We Know

Here I'd like to point out the excellent responses from karatekid430 and nivex, as they provide further insight into what it actually takes to fix the issue; which is rewriting code that is either using quite old libraries, or which uses a different programming pattern than should be used nowadays.

What does this mean?

If this originates from a library (go ahead, turn on gdb, or maybe try using ltrace, whatever works), then chances are Steam is either using an old library that can't be simply updated due to breaking changes, or which is not maintained anymore (also, off chance it could be a library they lost the source code for, or maybe licensing issues). Otherwise they would have to touch some code that may be used by a wide variety of other moving parts in the Steam codebase; fixing the issue there might break seemlingy unrelated parts as well.

How to proceed?

What I'm saying is, this is not a simple "fix DNS lul" issue, and it's also not just "use DNS instead". In effect this means that as long as Steam isn't fixing this we have two choices; bother them where it hurts until they fix it (see my earlier comment), or find ways to fix it ourselves. I'm asking you to either do the former, or the latter, but stop triggering my GitHub notifications unless you have something meaningful to bring to the table.

Why is this fix hard?

Static/Dynamic Resources vs. Behaviour

Now on to why "fix DNS lul" and "use DNS instead" would be easier fixes. The former could be circumvented by proxying DNS and rewriting the problematic parts (hello unbound). The latter could be circumvented by finding the hardcoded IP and replacing it. The issue we most likely have is that we'd have to change behaviour of some of the code. I'm not saying this is impossible, I'm saying you have to understand the problem first which might be harder than just looking for an IP.

Possible API Parameters

Another issue here that I'm vaguely aware of but which I cannot 100% confirm is that one of Steam's APIs requires an IPv4 address as a parameter, otherwise it will invalidate your session just about every other time you start up Steam. If this assumption of mine is correct then we'd either have to patch that too, or find some other way around it.

An Apology

I'm sorry for being so bold any wordy about this, this is a lot to read for people who already read the thread and I'm sorry for bother you good souls out there. However I'm not apologizing for saying any of this to those who haven't read the thread, because you are wasting my time and nerves. It is really annoying to see a response in this thread and it's just the same thing we had a dozen times over already, without any further input.

NiKiZe commented 2 years ago

Is this still, after 8 years? not resolved?

koutsie commented 2 years ago

Is this still, after 8 years? not resolved?

I'm starting to believe this is called "Valve Time".

TheFireKahuna commented 2 years ago

This needed to be actioned 8 years ago, before IPv6 only makes this a major problem for users

AesaraB commented 2 years ago

This issue is legitimately incredible, it's almost like a time capsule signifying Valve's total apathy

No0ne commented 2 years ago

This issue should at least be merged with https://github.com/ValveSoftware/steam-for-linux/issues/2912

vbtwo31984 commented 2 years ago

This issue plagues the Steam Deck too. By default it's not even able to connect to an IPv6-only network. I was able to change some network settings in desktop mode and connect, and then everything in desktop mode works (except Steam client), but the regular non-desktop view shows that there's no Internet access...

cherry-412 commented 2 years ago

also having this issue. my iphone hotspot produces a NAT64 network, making it impossible to bring the steam deck's gaming mode online while on the go. that's quite an inconvenience on you know.. a portable device

rawhide-kobayashi commented 2 years ago

my home internet recently went out for a bit, and I had to rely on a mobile hotspot with spotty ipv4 connectivity... shocked at how many sites still don't have ipv6 support. particularly ones that sell products. ebay, amazon, craigslist, indeed, reddit... GITHUB. there's non-zero customers out there, even in the US, who only have internet access through hotspots that are ipv6 only or have CGNAT strained by port exhaustion...

No0ne commented 2 years ago

Now MacOS Ventura automatically setups an integrated CLAT if it detects a NAT64/DNS64 network an Steam works! (see https://www.youtube.com/watch?v=zQk6YMO-7fw)

zajdee commented 2 years ago

Now MacOS Ventura automatically setups an integrated CLAT if it detects a NAT64/DNS64 network

A small correction: macOS CLAT is only set-up by the operating system if you provide a DHCPv4 option 108 ("IPv6-only preferred") and a pref64 ("NAT64 prefix") option in IPv6 router advertisements. DNS64 is not necessary for the CLAT to work, but you do want it for the other apps running on your system. (I am the author of the radvd patch Ondrej mentions in his talk and am currently running an IPv6-mostly network at home. I need to give Steam a try on it!)

No0ne commented 2 years ago

@zajdee 🤔 I don't have dhcp-opt 108 (actually no dhcp at all) nor pref64 enabled and it still works. I think macos and ios resolv ipv4only.arpa for checking dns64? Its same on ios since version 16.

zajdee commented 2 years ago

@zajdee 🤔 I don't have dhcp-opt 108 (actually no dhcp at all) nor pref64 enabled and it still works. I think macos and ios resolv ipv4only.arpa for checking dns64? Its same on ios since version 16.

CLAT is available if you see 192.0.0.2 in the output of ifconfig and can e.g. ping 1.1.1.1 (I have double checked this right now). If you can't, then there's something else in Steam that makes it work on the NAT64/DNS64 networks, and that's exciting!

No0ne commented 2 years ago
noone@imac20 ~ % ifconfig | grep clat
    inet6 fdee::1439:bc88:d58d:59de prefixlen 64 clat46
noone@imac20 ~ % ifconfig | grep 192
    inet 192.0.0.2 netmask 0xffffffff broadcast 192.0.0.2
noone@imac20 ~ % ping 1.1.1.1
PING 1.1.1.1 (1.1.1.1): 56 data bytes
64 bytes from 1.1.1.1: icmp_seq=0 ttl=57 time=24.911 ms
zajdee commented 2 years ago

@No0ne: oh, thanks. It looks like the behaviour I have described was active on macOS 12, but on macOS 13 the CLAT activates even when there's neither DHCPv4 Option 108 not pref64 in the router advertisements. (That's good news.)

TeamLinux01 commented 1 year ago

It would be nice for Valve to support IPv6 gaming. I have multiple Steam gaming devices and I can open the firewall ports easily for each device via IPv6.

The limitation of IPv4 NAT would only allow me one device at a time to use those ports.

Please Valve, run a dual stack for your servers and ask game developers to support a dual stack; IPv6 preferred when both are available.

cheako commented 1 year ago

The servers don't need to be dual-stacked for clients to p2p over v6. It's up to the app/game developers to implement this.

Leseratte10 commented 1 year ago

It's up to the app/game developers to implement this.

Hard to do when many of Valve's APIs for game devs still assume an IP fits into a 32-bit integer, like in the ISteamGameServer interface and probably many others.

Some newer Steam APIs like this one are finally beginning to support IPv6, but definitely not all of them.

And the Steam Client is still either connecting to hardcoded IPv4 addresses or ancient library calls like gethostbyname instead of getaddrinfo. This is a far bigger issue than the servers not having IPv6.

If the client were implemented correctly, with no hardcoded IPs and using getaddrinfo everywhere, all you'd need would be a NAT64 to use Steam on an IPv6-only connection, even if Valve's servers don't support that yet.

This is definitely something that Valve needs to fix by A) making the Steam Client work behind an IPv6-only connection with NAT64, without CLAT; then B) providing IPv6-capable versions of all their developer APIs. Only once that has happened, is it useful that C) Valve servers get working IPv6 and D) game devs using Valve APIs finally start supporting IPv6 (and IPv6-only).

Also, independant from the client, Valve has a lot to do regarding IPv6 on the Steam Deck, too, ...

cheako commented 1 year ago

I don't think games are stuck using the steam client for things like getaddrinfo, plus I doubt any p2p code is doing address lookups... I'm sure game devs have all the tools they need to use the full network stack regardless of what valve does.

NiKiZe commented 1 year ago

I don't think games are stuck using the steam client for things like getaddrinfo, plus I doubt any p2p code is doing address lookups... I'm sure game devs have all the tools they need to use the full network stack regardless of what valve does.

The Steam client don't work in in an NAT64 environment due to this bug, which is a oneline piece of code to change in the client. (Testing added on top of that might make the fix non trivial, but the code change itself should be)

Leseratte10 commented 1 year ago

Sure, if the game devs wanted, they could ignore all the features the Steam API offers, and just implement all of the p2p network logic themselves,, and also develop and host their own servers for matchmaking, then the game(s) would work over NAT64 / IPv6 just fine. But I don't think many devs are going to do that when Valve offers APIs that make that a whole lot easier.

cheako commented 1 year ago

This is the issue with every framework, they swallow innovation making applications a clone with only the skin to differentiate them. I don't think you'll win any awards that way.

frederictobiasc commented 1 year ago

Funny, we are approaching the 9th year of this issue remaining unresolved.

tiiiko commented 1 year ago

It’s 2023 and still no support. I can’t use my steam deck because of this. Next time I’ll buy literally any other device. 8 years and still no fix?!

cheako commented 1 year ago

@tiiiko Can't you deploy a router? I didn't think this was anything more than a nuisance, if there are unsurmountable effects those should be well documented in detail.

tiiiko commented 1 year ago

@tiiiko Can't you deploy a router? I didn't think this was anything more than a nuisance, if there are unsurmountable effects those should be well documented in detail.

Thank you for your reply. It’s a bit different for me. I have a nice PC and screen at home so I’d virtually never use my steam deck there. I’d like to play on the go, but my phone’s hotspot is IPv6 and cannot be changed. This means I have to hope there’s a good public WiFi somewhere, which in my experience unfortunately is something of a rare find in Germany.

growse commented 8 months ago

Happy 2024 everybody.

Mikaela commented 8 months ago

Did we have a Steam group chat for the beach house yet?

UnderEu commented 7 months ago

March 12, 2024: Not working yet

sgryphon commented 7 months ago

Steam can't even merge duplicate issues for this same problem; one since 2013, one 2014 -- that's over 10 years!

https://github.com/ValveSoftware/steam-for-linux/issues/2912 https://github.com/ValveSoftware/steam-for-linux/issues/3372

In that time IPv6 usage has grown from 2% to 45% (varies by country, some at 80-90%). There are now many IPv6-only networks -- several major mobile carriers, several ISPs, and IPv6-only is also common on guest networks (as phones and tablets support it well).

Steam is one of the major reasons why I haven't been able to switch my network over to IPv6-only, for easier single-stack management.