Hamachi can cause long load times

Started by Tanelorn, February 01, 2017, 07:02:09 PM

Previous topic - Next topic

Tanelorn

This was a horrible issue for me for months. I had load times up to a half hour. Same for Kerbal SP. Only today did I finally discover that Hamachi's virtual network connection causes horrible interference with both Rimworld and KSP load times. I don't see it listed here as a sticky so please add it as a known issue.

milon

It sounds like you're asking for a sticky post about something. Would you mind explaining the problem in more detail? Also, do you know the solution to the problem? If yes, what is it?

Tanelorn

Quote from: milon on February 02, 2017, 02:28:15 AM
It sounds like you're asking for a sticky post about something. Would you mind explaining the problem in more detail? Also, do you know the solution to the problem? If yes, what is it?

Yes. Is this an automated reply? I am asking for a sticky in the support forum. Hamachi creates a network drive which causes MASSIVE increases in Rimworld load times. I'm talking a difference between 1 minute and 30 minutes!!! Same for KSP believe it or not. The solution is to both stop the Hamachi process and disable the Hamachi virtual network drive.

milon

No, that wasn't an automated reply, but I can see how a bot could also have made such a reply.  I've just never heard of the brand Hamachi before and had no idea what product you were referring to.  It's really strange to me that the presence of a network drive (unused, I assume, from RimWorld's perspective) would cause such a lag in loading.  I did a quick google search, and it seems many KSP players are affected by this issue you're reporting.  Thanks for the tip.  I'll sticky this thread and we'll see if anyone else experiences this issue.

Tanelorn

Hamachi is a popular program that lets you play games in multiplayer by emulating a local connection. Good for games that don't have p2p internet support.

nccvoyager

LogMeIn Hamachi.
I remember using that...

At the core of how the program works for personal home use, Hamachi creates a VPN "tunnel" between up to five internet-connected computers.
This can be used to bypass some features of port-locked routers, and emulates a LAN connection between computers, allowing LAN-multiplayer features to be used online.

(I used to use Hamachi to bypass port restrictions at my high school to let us play games on the systems there. I spent more time learning to bypass restrictions than I did anything else. All that work I could have put into actual educational learning... Oh well.)

Other than bypassing restricted networks, this can also allow LAN-only multiplayer games (mainly speaking of games wherein the online multiplayer component servers have been shut down) to be played online in multiplayer.
(Some latency issues crop up when playing online. Better than nothing though.)

Unimportant droning from here on.

Hamachi can be set up to create several types of networks.
Mesh, Hub-and-Spoke, and Gateway.

In a mesh network, every computer is connected to every other computer directly.
This is great for emulated LAN gaming, and can be used as a virtual LAN setup for corporate entities without a physical LAN network.

In a hub-and-spoke network, all computers communicate to each other through a central computer.
This allows for shared networking while creating control over the connections within the network.

A gateway network is set up almost the same way as a hub-and-spoke network, but the gateway network allows for only a single hub, and allows any computer connected to the central "gateway" to access any device connected to the network.
(Note that this is any device, not just computer. Something hub-and-spoke or mesh networks have difficulty with is sharing printers, scanners, and fax machines.)

Outside of a corporate setting, you would probably only ever use a mesh network with Hamachi.

milon

That actually sounds pretty cool!  But RimWorld doesn't actively scan the LAN (right?) so why does it impact load time?  AFAIK, RimWorld only pings Ludeon on load to see if it's the most up to date version available.  And having a laggy network attached "shouldn't" (in my mind) interfere with directly requesting a page from outside the LAN...

nccvoyager

Hamachi creates a "virtual" network adapter in order to work the way it does.
(That virtual adapter connects to the network of computers as if it was a wired LAN connection.)

I don't understand the exact cause or reason, but if a program (like RimWorld) attempts to call/ping an internet-enabled server through that virtual adapter, some things can go wrong.

RimWorld attempts to ping/call a server during initialization, even with the DRM-free version, if my output_log file and in-game console are to be believed.
(Which, I admit, they may not be believed. Some weird stuff may be happening.)

Normally, this wouldn't be a problem.
Without internet, the request would timeout, and after a relatively short delay RimWorld would finish initializing anyways.
With internet, RimWorld would receive a reply and finish initializing.
With the Hamachi virtual adapter enabled and with some system configurations, this process can be interrupted or "hijacked" and the delay before timeout lengthened considerably.

(Now, I'm not an expert by any means, but if I had to guess, the Hamachi virtual adapter says "yeah, I'm working on it, give me a minute" to programs trying to call out.
The programs therefore do not timeout with a "no reply" and instead wait longer.
The Hamachi virtual adapter never actually sends the data anywhere though since it isn't a "real" network adapter, and it just sits there.
The program attempting to call out, meanwhile, was told to expect a reply, and therefore is set to a much longer timeout value than if it received no reply from the adapter.)

In terms of an end-user fix, disabling the virtual adapter works, and shutting down Hamachi works too.
(The virtual adapter sends no replies to data sent to it if Hamachi is not running, and therefore a "no reply" timeout would occur.)

On a software level, interrupting all requests when one positive reply is received would remove this issue on internet-enabled systems.
(I am unsure as to whether or not Ludeon has direct control over that though.)

milon

Interesting, nccvoyager, and thanks again. Is there anything you don't know? ;)

It seems to me that on a software level, RimWorld could avoid/mitigate this by making the server ping action a "non-blocking" function. For the non-coders, this means RimWorld does its normal shout out to Ludeon asking about updates, but then it doesn't wait for the answer. It would continue with the initialization process and would check only occasionally to see if Ludeon answered. Once or has an answer (or a timeout), the relevant message can be posted for the user.

But that might be more work than it's worth since RimWorld is already doing a lot of other stuff during initialization.

nccvoyager

I just have experience with bypassing router firewalls.  ;)
(I actually know very little about Windows 8 or newer, OSX, and Linux, just by the way.)

Yeah, it's one of those things that could be worked around, but has no effect on most people.