I use Debian testing amd64 as my only OS + I have a Zyxel Keenetic router that can be easily "rooted" with a prepared USB flash drive (no firmware update needed for that and it's a native supported functionality, it also supports opkg natively and installs software to the same flash drive. So I can test different cases and watch the actual traffic with tcpdump installed on the router. I also have a VPS in the Netherlands to check what exactly comes from my side. I tried to send a UDP packet from port 10002 to the VPS to port 10002. What I did:
On the router I launched
Code: Select all
tcpdump -n -i ppp0 host <VPS IP> and udp
Code: Select all
tcpdump -n -i eth0 port 10002
Code: Select all
echo "hello" | netcat -u -p 10002 <VPS IP> 10002
Code: Select all
14:53:10.331206 IP 172.21.20.30.10002 > <VPS IP>.10002: UDP, length 6
Okay, but what comes to the VPS?
Code: Select all
14:53:10.752733 IP <ISP WAN IP>.14766 > <VPS IP>.10002: UDP, length 6
Now, the problem is that Factorio server doesn't seem to handle this situation correctly. There are no warnings at all though I expect the whole system with multiple pingpong servers to detect this because it's the entire purpose of it! Check with different servers if the external port they see stays the same (and matches the internal port) or if it's randomized and unreliable. In the latter case the game simply can't be set up (without using relays of course) and there should be a big fat error/warning about that, probably the game shouldn't even be published in the public servers directory because it's physically not possible to connect to it. And yet this is what I get in the log:
Code: Select all
0.000 2020-04-12 17:03:48; Factorio 0.18.18 (build 50828, linux64, headless)
0.167 Operating system: Linux (Debian testing)
0.167 Program arguments: "bin/x64/factorio" "--start-server-load-latest" "--server-settings" "data/server-settings.json"
0.167 Read data path: /home/rkfg/Games/factorio/data
0.167 Write data path: /home/rkfg/Games/factorio [265917/937871MB]
0.167 Binaries path: /home/rkfg/Games/factorio/bin
0.170 System info: [CPU: Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz, 8 cores, RAM: 32080 MB]
0.170 Environment: DISPLAY=:0 WAYLAND_DISPLAY=<unset> DESKTOP_SESSION=awesome XDG_SESSION_DESKTOP=awesome XDG_CURRENT_DESKTOP=<unset> __GL_FSAA_MODE=<unset> __GL_LOG_MAX_ANISO=<unset> __GL_SYNC_TO_VBLANK=<unset> __GL_SORT_FBCONFIGS=<unset> __GL_YIELD=<unset>
0.170 Running in headless mode
0.172 Loading mod core 0.0.0 (data.lua)
0.205 Loading mod base 0.18.18 (data.lua)
0.368 Loading mod base 0.18.18 (data-updates.lua)
0.456 Checksum for core: 1106864506
0.456 Checksum of base: 332375697
0.582 Prototype list checksum: 586383188
0.612 Info PlayerData.cpp:68: Local player-data.json available, timestamp 1586684661
0.612 Info PlayerData.cpp:75: Cloud player-data.json unavailable
0.781 Factorio initialised
0.781 Info HttpSharedState.cpp:54: Downloading https://auth.factorio.com/api-login?api_version=4
2.060 Info AuthServerConnector.cpp:133: Got token from auth server for username(rkfg).
2.061 Info ServerSynchronizer.cpp:28: nextHeartbeatSequenceNumber(0) initialized Synchronizer nextTickClosureTick(0).
2.061 Info ServerMultiplayerManager.cpp:771: updateTick(4294967295) changing state from(Ready) to(PreparedToHostGame)
2.061 Info ServerMultiplayerManager.cpp:771: updateTick(4294967295) changing state from(PreparedToHostGame) to(CreatingGame)
2.061 Loading map /home/rkfg/Games/factorio/saves/mp.zip: 3710690 bytes.
2.068 Loading level.dat: 9748540 bytes.
2.071 Info Scenario.cpp:187: Map version 0.18.18-1
2.192 Loading script.dat: 328 bytes.
2.193 Checksum for script /home/rkfg/Games/factorio/temp/currently-playing/control.lua: 3441332399
2.195 Info UDPSocket.cpp:27: Opening socket at (IP ADDR:({0.0.0.0:34197}))
2.195 Hosting game at IP ADDR:({0.0.0.0:34197})
2.195 Info HttpSharedState.cpp:54: Downloading https://auth.factorio.com/generate-server-padlock-2?api_version=4
2.997 Info AuthServerConnector.cpp:66: Obtained serverPadlock for serverHash (npodnkXS14rBifh5LxTXZAiMBPNVR1fJ) from the auth server.
2.997 Info ServerMultiplayerManager.cpp:771: updateTick(988533) changing state from(CreatingGame) to(InGame)
3.285 Info ServerRouter.cpp:614: Asking pingpong servers (pingpong1.factorio.com:34197, pingpong2.factorio.com:34197, pingpong3.factorio.com:34197, pingpong4.factorio.com:34197) for own address
3.285 Info UDPSocket.cpp:39: Opening socket for broadcast
3.286 Info CommandLineMultiplayer.cpp:303: Maximum segment size = 100; minimum segment size = 25; maximum-segment-size peer count = 10; minimum-segment-size peer count = 20
3.437 Info ServerRouter.cpp:497: Own address is IP ADDR:({<ISP WAN IP>:64494}) (confirmed by pingpong1)
3.437 Info ServerRouter.cpp:497: Own address is IP ADDR:({<ISP WAN IP>:64494}) (confirmed by pingpong3)
3.588 Info ServerRouter.cpp:497: Own address is IP ADDR:({<ISP WAN IP>:64494}) (confirmed by pingpong4)
4.299 Info MatchingServer.cpp:114: Matching server game `7210794` has been created.
4.309 Info ServerMultiplayerManager.cpp:703: Matching server connection resumed
tl;dr hosting a game behind a provider NAT doesn't work and the game doesn't warn about that.