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

[feedback] Steam support for lancache #85

Open
mintopia opened this issue Jan 22, 2020 · 39 comments
Open

[feedback] Steam support for lancache #85

mintopia opened this issue Jan 22, 2020 · 39 comments
Labels
feedback A feedback request

Comments

@mintopia
Copy link
Member

Hi everyone! Posting this as a place to collate feedback, problems, suggestions and comments on the Steam support for lancache.

As of today's Steam Client update, there is now full support in Steam for a lancache. The way it works is by setting a DNS override for lancache.steamcontent.com pointing to the IP address of your cache server.

The Steam client will then use that cache server for all downloads. It will still make requests to the cache server using the hostname of the Valve content server to download from, but it will connect to your cache.

In addition, it will increase the maximum number of connections per IP from 4 to 32. This should solve the issue people have been seeing with slow initial downloads through lancache. It will also prevent the Steam Client from using Open Caching, which caused some downloads to not be cached correctly.

This has already been added to the uklans/cache-domains project, so any new deployments of lancachenet/monolithic and lancachenet/lancache-dns will pull in the new hostname for lancache.steamcontent.com; so you can take advantage of this now!

Valve have been amazingly helpful and supportive of getting this done, and they're keen to see lots of people use it. They also want all feedback, statistics, and any issues that people have so that they can help further.

@mintopia mintopia added the question Further information is requested label Jan 22, 2020
@mintopia mintopia pinned this issue Jan 22, 2020
@mintopia mintopia added feedback A feedback request and removed question Further information is requested labels Jan 22, 2020
@Fidelity88
Copy link

Fidelity88 commented Jan 22, 2020

Maybe a stupid question, but if you use the docker images, how do you update? When I run the docker pull command:
docker pull lancachenet/monolithic
It shows me all the pulled images, but the 'created date' shows 3 weeks ago?:

REPOSITORY TAG IMAGE ID CREATED SIZE
lancachenet/monolithic latest 8b98d66d825a 3 weeks ago 294MB
lancachenet/monolithic 79c5e54e0044 6 months ago 301MB
lancachenet/lancache-dns latest 323f72f1929b 7 months ago 316MB
lancachenet/sniproxy latest 050948a49b8d 7 months ago 7.55MB

Maybe the instructions should be updated to add an "How to update" section too?

@mintopia
Copy link
Member Author

I'll add notes about a 'How to update' section. In this case, you should just need to stop and then start your docker containers.

On startup, monolithic and lancache-dns should pull a new cache domain list from online and use it. You can look at the logs of the container to confirm this (using docker logs <container name>) or use nslookup to check that lancache.steamcontent.com is now resolving to your cache IP.

@bonkersGER
Copy link

The Steam-Client works perfectly :) and also at full speed ~50 MB/sec.

But it seems that SteamCMD does not use the new feature ~ 5-8 MB/sec

@Lepidopterist
Copy link
Member

Lepidopterist commented Jan 23, 2020

An excellent question.

I would suspect SteamCmd uses the same backend libraries that the client does, so the next release /may/ have this in.

We'll seek clarification from Valve

@maxvat22
Copy link

maxvat22 commented Jan 27, 2020

So can someone explain how to solve the miss'es im getting in the logs by adding the lancache.steamcontent.com ? It's been 4 days already i followed the tutorial and nothing is going ok. A tutorial about fixing the misses would be nice ....

@Lepidopterist
Copy link
Member

So can someone explain how to solve the miss'es im getting in the logs by adding the lancache.steamcontent.com ? It's been 4 days already i followed the tutorial and nothing is going ok. A tutorial about fixing the misses would be nice ....

Yep, it's likely we can solve that.

Without information, that likelihood approaches zero, although we could probably sit and speculate all day what would cause it.

Please raise a separate issue, including relevant logging information and we can take a look.

@maxvat22
Copy link

Done i posted my issue here: #90

@castrojo
Copy link

castrojo commented Feb 2, 2020

Some feedback after playing around with this a bunch with ~10 clients or so. Everything is faster than before. With my home gigabit connection I am now getting full speed to my regional Steam endpoint, before the initial download would be much slower (50mbit), despite adding multiple addresses, I could never get it to work fast, etc. So that bottleneck has totally been eliminated for me.

Cache hits are also faster? Normally a local LAN hit to one client would be 400mbit but now they're north of 800mbit; depending on the game. I can't explain why this would be but just reporting it.

@carroarmato0
Copy link

Here's a screenshot of the metrics taken from the cache server.
We had a 1Gb line for the LanParty and even though you can't distinguish the different game platforms you can see that it's a good improvement (using 5 IP addresses).

image

@guyhalestorm
Copy link

We used this at a big LAN this past weekend with over 100 clients. I used the docker-compose image, no tweaking or customizing beyond adjusting memory and storage size. We had an iffy internet connection, but averaged about 150 Mbps download speeds. It served up over 6.2 TB of data after downloading 2.2 TB of data from Thurs night through Sunday afternoon. I don't know about other clients but it worked perfectly for at least Steam and Blizzard downloads. Initial Blizzard downloads were slow, but we were able to precache pretty much everything prior to the event kicking off, so the attendees didn't notice. ;) Peak upload speed was 6.55 Gbps, which made getting a 10G card, switch, and a small stack of SSDs totally worth it. Y'all made this so easy, we couldn't have done it without you!

@DragonQ
Copy link

DragonQ commented May 30, 2020

I'm using the latest version of lancache/monolithic and the Steam client but I can't say I've noticed any improvement to uncached download speeds. It still seems hugely game-dependent. Some games seem to be near-full speed, but others are painfully slow still (e.g. Jackbox Party games last night were downloading at under 1 MB/s on a 10 MB/s connection).

I'm not using lancache-dns which I think means I can't set up multiple IPs, since every guide I can find for doing so includes setting up lancache-dns.

@astrolox
Copy link
Member

astrolox commented Jun 3, 2020 via email

@DragonQ
Copy link

DragonQ commented Jun 3, 2020

I use Pihole with conditional forwarding of the domains defined by uklans/cache-domains to lancache, rather than using lancache-dns. I've asked in Discord though, thanks for the tip.

@cjlarose
Copy link

cjlarose commented Aug 21, 2020

I set this up a little bit ago and just wanted to leave some feedback.

Currently, Steam will check to see if there's a DNS record for lancache.steamcontent.com. I imagine the logic on Steam's side is just to change the "maximum number of connections per IP" when that DNS record returns something in the RFC1918 address range. Steam will still issue separate DNS queries to each of the content servers when you download a game, so in order for this to work, we still need to set up something like lancache-dns to be the authority for those domains and to return the IP of the lancache proxy.

It'd be awesome if instead Steam would connect directly to the IP address returned from the initial DNS query for lancache.steamcontent.com. Of course, the actual domain name of the content server has to be communicated to the lancache proxy, but that can be done with the HTTP Host header.

That would make it so that if I only really wanted to use lancache for steam games, I don't have to run a separate DNS server like lancache-dns. I would just need to add a single DNS host override on my existing DNS server for the domain lancache.steamcontent.com. It would also mean that the community wouldn't have to maintain an ever-changing list of domains that are used for steam downloads.

@regner
Copy link

regner commented Aug 27, 2020

Steam will still issue separate DNS queries to each of the content servers when you download a game, so in order for this to work, we still need to set up something like lancache-dns to be the authority for those domains and to return the IP of the lancache proxy.

I don't understand. Just looking at getting things setup, but based on the description in the OP this your comment doesn't make sense to me. So I assume I am missing something.

The way it works is by setting a DNS override for lancache.steamcontent.com pointing to the IP address of your cache server.

The Steam client will then use that cache server for all downloads. It will still make requests to the cache server using the hostname of the Valve content server to download from, but it will connect to your cache.

The way I read it is, if Steam gets a result for the DNS query lancache.steamcontent.com, all requests for content will go through your cache server. They will come with the wrong hostname, but that shouldn't be a problem.

@unspec
Copy link
Member

unspec commented Aug 28, 2020

Obviously only Valve know the exact behaviour of their client, however its our understanding that lancache.steamcontent.com is the only required DNS entry since the change was made to the client in January. The other steam related hostnames have not been removed from the cache-domains list as yet, but it should be possible to remove all but lancache.steamcontent.com and still have it work.

I.E steam DOES use the IP returned from that hostname - its not purely a "exists or does not exist" trigger record.

Admittedly due to Covid we havent had much in the way of LAN events this year to gather the usual real world lancache data, but none of the team have reported any issues with home/test setups.

@Lepidopterist
Copy link
Member

uklans/cache-domains#124 is relevant, and as @unspec says - due to the lack of LANs we've not been able to test in all environments before we merge this change. That being said, we do have test setups running successfully so there is minimal risk. I suspect we can merge this relatively soon.

@mintopia
Copy link
Member Author

mintopia commented Aug 28, 2020

The intended behaviour of the Steam client is that you should only ever need to hijack lancache.steamcontent.com. This is from our original email from Valve in December 2019:

The idea for this is essentially the Steam lancache can operate by hijacking only one DNS entry – that of lancache.steamcontent.com. The Steam client will proxy all requests through that host, with a “host” header indicating the upstream host it would have otherwise talked to. This is similar to the Site License Server cache, but much simpler to set up.

Once this is out and working well, we will probably begin pushing more of our servers to use HTTPS. The Steam client will just use HTTP to any lancache, and it will still be fine for the lancache to use HTTP for its upstream requests. It’s just that if the Steam client is talking directly to a Steam server, it will choose HTTPS.

They also confirmed that the Steam client increases the number of TCP connections from 4 to a max of 32 when using a lancache:

When there’s a configured proxy – which should include the lancache – the Steam client will use up to 32 TCP connections to that host (instead of the usual 4 max per host). So that should help with the performance too.

@rotanid
Copy link

rotanid commented Aug 28, 2020

great. i hope it's not limited to RFC1918 IPv4 addresses as we use public ones, but i can't check it this year due to the virus situation.
last thing steam needs to to: fully support IPv6 :D ValveSoftware/steam-for-linux#3372

@mintopia
Copy link
Member Author

mintopia commented Aug 28, 2020

Valve have stated it needs to resolve to RFC1918 addresses:

The requirements are that the address returned by the lancache.steamcontent.com lookup be on a private IP – so 10.0.0.0/8, 127.0.0.0/8, 172.16.0.0/12, and 192.168.0.0/16 for ipv4 or fc00::/7 and fe80::/10 for ipv6.

This is also the same for HTTPS downgrade on Riot and Origin.

One solution is to have a private internal range that your router can route to, provide that in DNS lookup for clients, so even though they have a public IP, the lancache is still on RFC1918 and they can still route to it from your LAN.

@rotanid
Copy link

rotanid commented Aug 28, 2020

One solution is to have a private internal range that your router can route to, provide that in DNS lookup for clients, so even though they have a public IP, the lancache is still on RFC1918 and they can still route to it from your LAN.

thanks, i simply forgot that we already have this...

@cjlarose
Copy link

Thanks for all of the responses and for the clarification of how the feature works!

I set everything up again to set up a STR to reproduce the problem I was seeing, but everything looks like it's working as expected now. The steam client connects directly to the IP returned from the DNS query for lancache.steampowered.com for all content downloads. Thanks everyone!

@h0m3
Copy link

h0m3 commented Jan 11, 2023

I'm having some problems with Linux clients and the Steam Deck. Both need a /etc/hosts forcing lancache.steamcontent.com to my monolithic IP otherwise steam wont use the DNS cache. You can curl the address and it will hit but steam itself wont use it.

Other people posted on the Steam Forums the same issue: https://steamcommunity.com/app/1675200/discussions/0/3267932441832871889/

I believe is more a Steam issue than a lancache issue, somehow steam is not checking for lancache.steamcontent.com on Linux machines unless you force it through hosts.

@duskmoss
Copy link

duskmoss commented Jan 13, 2023

Also having the issue mentione by @h0m3 on linux ... but strangely steamdeck works great

edit: tested again on steamdeck

@archi
Copy link

archi commented Sep 4, 2023

With the advent of "Game File Transfer over Local Network" earlier this year, a new hurdle came to LanCache (at least at our last LAN with 8 people):
A user had enabled it for "everyone" (not sure if the receiver also had it enabled, or if it was enough to have a willing sender). Anyway, other attendees then flocked to his GbE-connected host for downloads, getting slow speeds while the LanCache's 10 GbE link was idle. We then had everyone disable that feature.
For our small party this wasn't a big hassle, just a surprise (1st time with a LanCache instance). But for big parties this might be an issue.

I know this isn't an actual LanCache issue, it's in the Steam logic that picks the data source. Maybe you have contacts at Valve to help you figure out if this is intentional or an accident. But I felt like you might be interested to know this.

According to the Steam docs data traffic is on port 24070 TCP. Discovery is not mentioned and I only have a single machine with Steam installed here; that one only broadcasts the steam discovery protocol on 27036. Disabling/enabling the file transfer feature didn't seem to alter the packages.

@zunder1990
Copy link

One thing I have done in the past for my lan is run all ports facing end users in protection mode, then leave the uplink or server ports in normal mode. Ports in protected mode are not allowed to send frames/packets to another port in protection mode. Protected ports are only allowed to send traffic to normal mode. This would block the steam feature @archi is talking about and give the added benefit of protecting people computer from viruses or bad actors. The down side with this it makes it harder for people to self host game servers.

@astrolox
Copy link
Member

astrolox commented Sep 5, 2023

@archi not sure if our contact at valve will have much to say but I guess we can ask. No promises.

@archi
Copy link

archi commented Sep 5, 2023

Hahaha, I wasn't expect you to "fix" this, since this is outside your control :) But since this was not yet mentioned anywhere, I thought it might be sensible to mention the caveat. Especially at a bigger LAN party this might come as an unexpected surprise to both attendees and organizers ;-)

OTOH: At scale, central caching for new data (=LanCache) pairs well with decentralized distribution of existing data (=GFToLN). However, this isn't trivial and only Valve knows how smart or dumb the whole GFToLN scheme is :)

btw, is that GFToLN? GFT? GoL? 🤔

@crkinard
Copy link

crkinard commented Jan 13, 2024

Seems like the windows client is doing the same thing.

Pinging lancache.steamcontent.com resolves to the lancache server.
The Steam prefill app works fine. Can tell it to precache something and watch the cache and logs populate properly.

Steam client however does not hit the lancache server at all unless you modify the hosts file then it works as it should.

So I guess until further notice lancache is basically broken for Steam.

Steam Beta Branch: Stable Client
Steam Version: 1705108172
Steam Client Build Date: Fri, Jan 12 7:54 PM UTC -08:00
Steam Web Build Date: Fri, Jan 12 12:02 PM UTC -08:00
Steam API Version: SteamClient021

EDIT: Something I just thought. The client still works if you modify the hosts file so this means support is still basically in the client as at least from that DNS it accepts downloading from HTTP not requiring HTTPS.

So the only thing I can think of the new clients have hardcoded DNS servers. Hosts file is parsed before DNS so that's why putting a entry in there works but DNS does not. Now to find out how to see if the Steam client is querying my DNS server at all or its using a internal hard coded DNS server (like a lot of things have been doing lately which is a pain in the ass).

@rotanid
Copy link

rotanid commented Jan 14, 2024

@crkinard cant confirm, worked for us just fine a week ago.

@mintopia
Copy link
Member Author

@crkinard Things we have found that can cause this issue on Windows is:

  • Having multiple DNS servers configured (you should have only LanCache DNS)
  • IPv6 Enabled (Windows may be using IPv6 servers, not LanCache DNS)
  • Internet Security software (It will detect DNS hijacking and instead send the query to an online DNS server instead)

Check for all of those.

@crkinard
Copy link

crkinard commented Jan 24, 2024

  • Only have one DNS server on my home network.
  • IPv6 disabled on router. Zero IPv6 connectivity to the internet.
  • Only 'internet security software' is what comes default with windows.

@mintopia
Copy link
Member Author

I can only suggest it's something odd with your individual setup, I tested it at a LAN party last week and it worked as expected with the latest containers. If you drop into our Discord server, more people may be able to help troubleshoot what's happening here.

@mintopia
Copy link
Member Author

As an update on potential issues with the Linux Steam client, I have reported this to Valve and they are looking into it.

@bedaes
Copy link

bedaes commented Mar 24, 2024

Works great on Windows. But I can confirm that the Linux Steam client skips the lancache server completely. Not even adding lancache.steamcontent.com to /etc/hosts solves it for me.

@kbgvirus
Copy link

kbgvirus commented May 14, 2024

I cannot get lancache working with steam. All my other clients are working fine. When i ping lancache.steamcontent.com this resolves to my lancache server

Steam Beta Branch: Stable Client
Steam Version: 1715635533
Steam Client Build Date: Tue, May 14 00:04 UTC -08:00
Steam Web Build Date: Mon, May 13 20:06 UTC -08:00
Steam API Version: SteamClient021

similar to @crkinard

@guyhalestorm
Copy link

guyhalestorm commented May 14, 2024 via email

@kbgvirus
Copy link

Just as a sanity check, your clients have disabled this option, correct? [image: image.png]

On Tue, May 14, 2024 at 6:46 AM Alon Nitzan @.> wrote: I cannot get lancache working with steam. All my other clients are working fine. When i ping lancache.steamcontent.com this resolves to my lancache server — Reply to this email directly, view it on GitHub <#85 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEC6RYQCOOKPETMC6I3JFB3ZCH2THAVCNFSM4KJ5NUZKU5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TEMJQHE4TSNRWGM2Q . You are receiving this because you commented.Message ID: @.>

Hi, your image did not get attached to the response. Which setting are you referring to?

@guyhalestorm
Copy link

guyhalestorm commented May 15, 2024 via email

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

No branches or pull requests