[Kovarex] [14.9] Server stutters on player disconnect with NAT

Bugs that we were not able to reproduce, and/or are waiting for more detailed info.
Post Reply
Yehn
Fast Inserter
Fast Inserter
Posts: 111
Joined: Tue Jul 12, 2016 3:45 am
Contact:

[Kovarex] [14.9] Server stutters on player disconnect with NAT

Post by Yehn »

When a player disconnects from a multiplayer session with a server behind NAT implemented with iptables, all players still in game will momentarily see the 'Server is not responding' progress bar. The exact time before the server starts responding again varies, can be less than a second or several seconds.

NAT rules in play:

Code: Select all

iptables -t nat -A PREROUTING -p udp -d 104.255.169.247 --dport 34197 -j REDIRECT --to-port 35001
iptables -t nat -A POSTROUTING -p udp -s localhost --sport 35001 -j SNAT --to-source 104.255.169.247:34197
iptables -t nat -A POSTROUTING -p udp -s 104.255.169.246 --sport 35001 -j SNAT --to-source 104.255.169.247:34197

iptables -t nat -A PREROUTING -p udp -d 104.255.169.246 --dport 34197 -j REDIRECT --to-port 35000
iptables -t nat -A POSTROUTING -p udp -s localhost --sport 35000 -j SNAT --to-source 104.255.169.246:34197
iptables -t nat -A POSTROUTING -p udp -s 104.255.169.246 --sport 35000 -j SNAT --to-source 104.255.169.246:34197
As implied by the rules, dual server instances are running on ports 35000 and 35001.

Oarc
Fast Inserter
Fast Inserter
Posts: 101
Joined: Sun Sep 18, 2016 2:04 pm
Contact:

Re: [14.9] Server stutters on player disconnect with NAT

Post by Oarc »

I also see this occasionally on some disconnects. If I look at my task manager upload monitor, it's 0kbps (from factorio) until the issue resolves.
I don't have any special routing. (I'm just behind a typical home internet connection, using a dedicated server).

Yehn
Fast Inserter
Fast Inserter
Posts: 111
Joined: Tue Jul 12, 2016 3:45 am
Contact:

Re: [Kovarex] [14.9] Server stutters on player disconnect with NAT

Post by Yehn »

Ok. I haven't seen it on my mono-server (a small VM with only 1 factorio instance, only 1 IP and no special routing), which is why I thought maybe factorio was acting funny with NAT. But I'm definitely seeing it now.

kovarex
Factorio Staff
Factorio Staff
Posts: 8078
Joined: Wed Feb 06, 2013 12:00 am
Contact:

Re: [Kovarex] [14.9] Server stutters on player disconnect with NAT

Post by kovarex »

Yehn wrote:When a player disconnects from a multiplayer session with a server behind NAT implemented with iptables, all players still in game will momentarily see the 'Server is not responding' progress bar. The exact time before the server starts responding again varies, can be less than a second or several seconds.

NAT rules in play:

Code: Select all

iptables -t nat -A PREROUTING -p udp -d 104.255.169.247 --dport 34197 -j REDIRECT --to-port 35001
iptables -t nat -A POSTROUTING -p udp -s localhost --sport 35001 -j SNAT --to-source 104.255.169.247:34197
iptables -t nat -A POSTROUTING -p udp -s 104.255.169.246 --sport 35001 -j SNAT --to-source 104.255.169.247:34197

iptables -t nat -A PREROUTING -p udp -d 104.255.169.246 --dport 34197 -j REDIRECT --to-port 35000
iptables -t nat -A POSTROUTING -p udp -s localhost --sport 35000 -j SNAT --to-source 104.255.169.246:34197
iptables -t nat -A POSTROUTING -p udp -s 104.255.169.246 --sport 35000 -j SNAT --to-source 104.255.169.246:34197
As implied by the rules, dual server instances are running on ports 35000 and 35001.
Does it happen when you run only 1 Factorio?
Does it happen when you don't use iptables?

Post Reply

Return to “Pending”