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

Add UPnP support to automate port forwarding of the random Steam SDR Ports #99

Open
ubergarm opened this issue Jun 3, 2022 · 4 comments

Comments

@ubergarm
Copy link

ubergarm commented Jun 3, 2022

After hosting a private game and having frequent client disconnects, I discovered that the V Rising Dedicated Server will open 1 or 2 additional UDP listener ports beyond the default configured 9876 and 9877.

Client disconnects will appear like this in the server log file:

SteamLog [SDR k_ESteamNetworkingSocketsDebugOutputType_Msg] [#3103221372 UDP steamid:12345678901234567@123.123.123.123:50960] Timed out.  17457.8ms since last recv, 10007.0ms since timeout started, 23 consecutive failures
...
SteamLog [SDR k_ESteamNetworkingSocketsDebugOutputType_Msg] [#3103221372 UDP steamid:12345678901234567@123.123.123.123:50960] problem detected locally (5003): Connection dropped

Manually checking what random ports are opened after starting the server and configuring the router OpenNAT Port Forwarding seems to have fixed the issue. In this example you can see ports 51909 and 60908 were randomly chosen for listening and must be port forwarded.

$ ss -nltpu
Netid  State   Recv-Q  Send-Q   Local Address:Port    Peer Address:Port Process
udp    UNCONN  0       0              0.0.0.0:9876         0.0.0.0:*     users:(("wineserver64",pid=14353,fd=388),("VRisingServer.e",pid=14351,fd=210))
udp    UNCONN  0       0              0.0.0.0:9877         0.0.0.0:*     users:(("wineserver64",pid=14353,fd=345),("VRisingServer.e",pid=14351,fd=156))
udp    UNCONN  0       0              0.0.0.0:51909        0.0.0.0:*     users:(("wineserver64",pid=14353,fd=362),("VRisingServer.e",pid=14351,fd=182))
udp    UNCONN  0       0              0.0.0.0:60908        0.0.0.0:*     users:(("wineserver64",pid=14353,fd=359),("VRisingServer.e",pid=14351,fd=180))

NOTE It is possible that some other thing actually fixed the issue e.g. using OpenNAT or downing the servers second NIC. More discussion in the gist below.

I opened a bug ticket about it in the official tracker here:
https://bugs.playvrising.com/suggestions/304500/dedicated-server-sdr-timeout-connection-dropped

Here is a gist writeup of everything here:
https://gist.github.com/ubergarm/00d2f0499162042a2b9a128407cc803d

Cheers, its a fun game!

@gdragon-git
Copy link

Devs, please add this. I'm experiencing disconnect issues from a dedicated server with multiple clients as per the OP's original description of the issue here: https://bugs.playvrising.com/suggestions/304500/dedicated-server-sdr-timeout-connection-dropped

My server hosting company isn't helping me yet to the same extent the OP could help themselves. Please help.

@kuwas
Copy link

kuwas commented Jun 22, 2022

My server has three NICs, I couldn't figure out why it wasn't working until I read this and disabled the other two NICs. It's kind of silly the server bound to 0.0.0.0 doesn't work because it bound itself only to the secondary NIC that isn't opened to the internet.

@ubergarm
Copy link
Author

ubergarm commented Jul 7, 2022

@kuwas - interesting, it may be possible that downing my extra NIC was the actual fix. I haven't had a single client drop (remote or local) since posting this ticket and hundreds of combined hours of game-play.

I noticed that in the ServerHostSettings.json it defaults to Address: None. I manually set mine out of habit to 0.0.0.0 after the fact, because None is not clear to me if it binds to a single NIC or what...

fwiw here is a snippet of my config:

{
  "Name": "Type O Negative PvE",
  "Description": "Welcome to Type O Negative PvE Private Server!\nLast Update 16 June 2022 Build 8947468\n- 3x castle hearts per player\n- 100% recovery on dismantle\n- 2x Minimum space between castles: NO BOXING IN!\n- All containers & corpses clan lootable only\n- 25% gear damage penalty on death\n- Plentiful Soul Shards\n---\nContact ubergarm on discord for server assistance\nMay your blood always be pure, and your mind fully empty!",
  "Port": 9876,
  "QueryPort": 9877,
  "Address": "0.0.0.0",   # <--- it used to be empty/none/null, so I set it to "0.0.0.0" to bind to all IP open to world
  "MaxConnectedUsers": 32,
  "MaxConnectedAdmins": 4,
...
}

@kuwas
Copy link

kuwas commented Jul 7, 2022

@kuwas - interesting, it may be possible that downing my extra NIC was the actual fix. I haven't had a single client drop (remote or local) since posting this ticket and hundreds of combined hours of game-play.

I noticed that in the ServerHostSettings.json it defaults to Address: None. I manually set mine out of habit to 0.0.0.0 after the fact, because None is not clear to me if it binds to a single NIC or what...

fwiw here is a snippet of my config:

{
  "Name": "Type O Negative PvE",
  "Description": "Welcome to Type O Negative PvE Private Server!\nLast Update 16 June 2022 Build 8947468\n- 3x castle hearts per player\n- 100% recovery on dismantle\n- 2x Minimum space between castles: NO BOXING IN!\n- All containers & corpses clan lootable only\n- 25% gear damage penalty on death\n- Plentiful Soul Shards\n---\nContact ubergarm on discord for server assistance\nMay your blood always be pure, and your mind fully empty!",
  "Port": 9876,
  "QueryPort": 9877,
  "Address": "0.0.0.0",   # <--- it used to be empty/none/null, so I set it to "0.0.0.0" to bind to all IP open to world
  "MaxConnectedUsers": 32,
  "MaxConnectedAdmins": 4,
...
}

@ubergarm I brought up all three NICs and set Address to the internal static IP of the NIC I wanted to use, 10.0.0.x. Now the server seems to work correctly.

After running a Conan server with the dedicated server tool, which has a specific drop-down for NIC choice, I now believe this is typical of Valve-style dedicated servers. So I believe the "fix" is to simply use the internal IP of the NIC you want to bind.

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

No branches or pull requests

3 participants