[0.11.13] Connecting to MP game from same IP doesn't work

Bugs that are actually features.
thul
Burner Inserter
Burner Inserter
Posts: 6
Joined: Tue Jan 20, 2015 11:28 am
Contact:

[0.11.13] Connecting to MP game from same IP doesn't work

Post by thul »

Me and a friend have a headless server running, when we're both at our homes with different (WAN) IP's we can connect to the server fine.

But when we share the same (WAN) IP (cause of NAT) at work only 1 of us is able to connect.
The first person to connect will stay connected, the second one will not be able to connect.

The logs will show that "<IP> has been dropped from the game". If the connected player disconnects the other one can connect just fine.

note: this has been an issue for a while for us, not something that was introduced in the latest version.

FishSandwich
Smart Inserter
Smart Inserter
Posts: 1847
Joined: Sun Feb 23, 2014 3:37 pm
Contact:

Re: [0.11.13] Connecting to MP game from same IP doesn't wor

Post by FishSandwich »

I don't think this is a bug, because if you share the same IP how will the game know what computer to send the information to?

If you're on a LAN, you need to find your IP address for that and use that one instead(usually something like 192.168.x.x, or along those lines)

thul
Burner Inserter
Burner Inserter
Posts: 6
Joined: Tue Jan 20, 2015 11:28 am
Contact:

Re: [0.11.13] Connecting to MP game from same IP doesn't wor

Post by thul »

Not sure if that's the issue, cause the NAT router would stop any incoming connections. In my opinion it should be working and it is currently bugged.

Cloner
Fast Inserter
Fast Inserter
Posts: 100
Joined: Tue Dec 09, 2014 12:59 pm
Contact:

Re: [0.11.13] Connecting to MP game from same IP doesn't wor

Post by Cloner »

You can configure NAT to forward specific port to one computer, but i donno what to do about second computer. Better use Evolve- it will give each one of you one unique IP.

thul
Burner Inserter
Burner Inserter
Posts: 6
Joined: Tue Jan 20, 2015 11:28 am
Contact:

Re: [0.11.13] Connecting to MP game from same IP doesn't wor

Post by thul »

The game shouldn't make people "unique" by their IP address, but by port, since every user gets a dedicated port to connect to and send/receive data. Just like most other games that offer MP, like Minecraft.

Something like Evolve won't work on Ubuntu and Hamachi is near impossible to use on Linux. We are also unable to modify the router cause we're at work and don't have access to this hardware.
MP should work without having to jump through hoops for the client.

FishSandwich
Smart Inserter
Smart Inserter
Posts: 1847
Joined: Sun Feb 23, 2014 3:37 pm
Contact:

Re: [0.11.13] Connecting to MP game from same IP doesn't wor

Post by FishSandwich »

Okay, you make good points. Either way, I don't think it is a bug of this version, because this version was designed to work correctly on LAN, not WAN. So things like NAT IPs, ports etc weren't taken into consideration.

A better multiplayer experience is promised for 0.12, so it's likely something that'll be implemented into that version.
MP should work without having to jump through hoops for the client.
You're playing the experimental version of multiplayer. That is an unrealistic expectation.

Cloner
Fast Inserter
Fast Inserter
Posts: 100
Joined: Tue Dec 09, 2014 12:59 pm
Contact:

Re: [0.11.13] Connecting to MP game from same IP doesn't wor

Post by Cloner »

thul wrote:We are also unable to modify the router cause we're at work and don't have access to this hardware.
If you cant forward ports, im not sure if there is anything the game can do... Its the same as you CANNOT create game in Warcraft 3 at your work, if bettlenet port isnt forwarded.

They might implement UPNP port forwarding, but thats normally disabled at work either.

User avatar
cube
Former Staff
Former Staff
Posts: 1111
Joined: Tue Mar 05, 2013 8:14 pm
Contact:

Re: [0.11.13] Connecting to MP game from same IP doesn't wor

Post by cube »

This thing should work out of the box, clients are identified using address and port pair. Could you please post log files from both computers that are connecting from the single WAN IP?

Cloner
Fast Inserter
Fast Inserter
Posts: 100
Joined: Tue Dec 09, 2014 12:59 pm
Contact:

Re: [0.11.13] Connecting to MP game from same IP doesn't wor

Post by Cloner »

cube wrote:This thing should work out of the box, clients are identified using address and port pair. Could you please post log files from both computers that are connecting from the single WAN IP?
Wont work unless you forward the ports on router?

User avatar
DaveMcW
Smart Inserter
Smart Inserter
Posts: 3700
Joined: Tue May 13, 2014 11:06 am
Contact:

Re: [0.11.13] Connecting to MP game from same IP doesn't wor

Post by DaveMcW »

I think cube is saying they should use different ports for each player.

UDP does not need to be forwarded unless you are the host, see http://en.wikipedia.org/wiki/UDP_hole_punching

thul
Burner Inserter
Burner Inserter
Posts: 6
Joined: Tue Jan 20, 2015 11:28 am
Contact:

Re: [0.11.13] Connecting to MP game from same IP doesn't wor

Post by thul »

This is part of the log that is about connecting to the server where my friend is already connected.

My friend has the exact same error(s) when im already connected. If you need both full log files (or update to date ones) let me know.
factorio-current.log

User avatar
DaveMcW
Smart Inserter
Smart Inserter
Posts: 3700
Joined: Tue May 13, 2014 11:06 am
Contact:

Re: [0.11.13] Connecting to MP game from same IP doesn't wor

Post by DaveMcW »

thul wrote:My friend has the exact same error(s) when im already connected.
If your ports are exactly the same, that's the problem!

rorror
Fast Inserter
Fast Inserter
Posts: 241
Joined: Fri Nov 21, 2014 9:02 pm
Contact:

Re: [0.11.13] Connecting to MP game from same IP doesn't wor

Post by rorror »

Connecting trough nat, from your inside to your extern ip adres, will never work.
you can't NAT from inside, to oudsite, and back to inside trough an open port on your WAN IP, to connect to a device in your internal network.

if your in the same LAN, you should always connect on the internal ip adres of the server. (the ip, tat you gave up, to open the port in your firewall)

in buisness practice we resolve the issue, by manuplicating dns entry's to resolve for example, factorio.youromain.com from the internal network to 10.0.0.1 and when you acces that domain from external (from internet) you get back the public ip adress (wan) of your router, and be able to connect to the server on both ways.

but what you want only possible by connection on the internal ip.

Cloner
Fast Inserter
Fast Inserter
Posts: 100
Joined: Tue Dec 09, 2014 12:59 pm
Contact:

Re: [0.11.13] Connecting to MP game from same IP doesn't wor

Post by Cloner »

rorror wrote:Connecting trough nat, from your inside to your extern ip adres, will never work.
Of course it will, just need to setup port forwarding on router.

rorror
Fast Inserter
Fast Inserter
Posts: 241
Joined: Fri Nov 21, 2014 9:02 pm
Contact:

Re: [0.11.13] Connecting to MP game from same IP doesn't wor

Post by rorror »

Cloner wrote:
rorror wrote:Connecting trough nat, from your inside to your extern ip adres, will never work.
Of course it will, just need to setup port forwarding on router.
It won't work from inside your LAN. It will only work from the rest of the Internet. Here's why:

You try to reach your public IP address from a LAN machine.

1 The machine sees that the address is outside the LAN and sends the packet to the router.

2 The router NATs the destination to the LAN machine, but the source address is unmodified (still the LAN machine that originated the request).

3 Your server receives the request and sends a response to the source of the connection (still the LAN machine).

4 The LAN machine receives a response from the server, but it was expecting a response from the router (since it connected to the public IP address, it must get a response from the public IP address, not the server's LAN address). Since the reply has the wrong source address, it is not accepted. Oops.

Port forwarding (rewriting the destination address) only works from the outside to the inside, not from the inside to the inside. For that, you need hairpin NAT which rewrites the destination address in addition to the source. And something like this, is not possible on normal cheap consumer routers/firewalls that you buy in stores for normal prices.




The total issue, is that, it is not a game bug, but a network infrastructure flaw of nat {when you use in on one network, and connect to your own public ip adress)

thul
Burner Inserter
Burner Inserter
Posts: 6
Joined: Tue Jan 20, 2015 11:28 am
Contact:

Re: [0.11.13] Connecting to MP game from same IP doesn't wor

Post by thul »

The server is located externally, hosted on a dedicated server. It is not on our local LAN at work.

Most likely would be that we both get assigned the same port? Which is odd, cause i would imagine the server would keep track of which ports are available.

It almost seems like the server thinks the second player connecting is actually the first player.

User avatar
DaveMcW
Smart Inserter
Smart Inserter
Posts: 3700
Joined: Tue May 13, 2014 11:06 am
Contact:

Re: [0.11.13] Connecting to MP game from same IP doesn't wor

Post by DaveMcW »

The server doesn't assign ports, YOU assign ports.

Look in config.ini and change one of them.

User avatar
cube
Former Staff
Former Staff
Posts: 1111
Joined: Tue Mar 05, 2013 8:14 pm
Contact:

Re: [0.11.13] Connecting to MP game from same IP doesn't wor

Post by cube »

Just to be sure: your situation looks like this:?

Code: Select all

               / --- A
Server ---- NAT
               \ --- B
A connects to Server and it works, B connects to server and gets dropped?

If yes, then A and B need to communicate with each other not using their private addresses, but using the external address:port that gets assigned by the router. This is called NAT loopback and theoretically it should work. At least all routers that I've tried so far can do this.

But the log file says that A and B cannot comunicate (in the VerifyingConnection state we try to communicate with all peers in game to check for exactly this kind of problems), so I would guess that your router is different :-)

I don't know how much you want to play with it and how much control you have over the router. It could be something configurable, it could be a feature that gets added in next firmware update, ...
It should be possible to verify what the router does running wireshark both on A and Server and trying to send an udp packet using netcat from A to server and then from A to A using the external address, if you are into these sort of things :-)

thul
Burner Inserter
Burner Inserter
Posts: 6
Joined: Tue Jan 20, 2015 11:28 am
Contact:

Re: [0.11.13] Connecting to MP game from same IP doesn't wor

Post by thul »

The situation describes is exactly how it is yes. Unfortunately we have 0 control over the router and we have no idea what kind of router it is either.

We might be able to do a packet dump on the server, but we'd need something else than wireshark. Server has no X11 installed on it :) We will try to figure something out.

User avatar
ssilk
Global Moderator
Global Moderator
Posts: 12888
Joined: Tue Apr 16, 2013 10:35 pm
Contact:

Re: [0.11.13] Connecting to MP game from same IP doesn't wor

Post by ssilk »

Cool suggestion: Eatable MOUSE-pointers.
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...

Post Reply

Return to “Not a bug”