Knowledge Base

How Rust's move from Raknet to Steam Query port will affect Rust Dedicated Servers

Note: this article has been updated as of September 26, 2023 to reflect the current status of the implementation of this change by Facepunch.

Background and Summary

On November 3rd, 2022, Facepunch studios released its monthly patch to Rust, which included the following statement:

"We have plans in place to switch the default networking layer of Rust servers from RakNet to Steam Networking in late November or early December, further communication will follow. This change requires servers to have a separate Steam query port set via the -queryport server startup parameter. When no query port is set, the server will default to either game port + 1 or rcon port + 1, depending on which number is larger. Hosts of shared servers will need to ensure the query port is forwarded correctly, which is why we are making this announcement ahead of time. Servers can be switched over to Steam Networking for testing via the -swnet startup parameter, which we recommend doing ahead of time in order to ensure a smooth transition."

In summary, Facepunch is asking server owners and hosts to utilize the -swnet and -queryport startup arguments to prepare for the transition from the legacy query system and RakNet game networking to a new query system and Steamworks game networking.

This means that, server owners will need to select a query port, which will be used by the server browser to determine the following:

  • Server Ping
  • Server Name, Description
  • Number of players

Use of the -swnet switch (Steamworks)

The -swnet switch is utilized in order to change the networking protocol from Raknet to Steamworks. As of the time of this writing, the current production and staging branch of the Steam client is able to see server listings which use the -swnet switch, as well as the default RakNet. At the time of the update to this article, it was We anticipate that the -swnet switch will be eventually depreciated and removed at some point in the future, following the full transfer to Steamworks.

It is also important to note that, when the Rust game client connects to a Rust server, the game will try to use RakNet first, and then Steamworks. For this reason, currently, servers which use the -swnet switch will cause Rust game clients to connect to the server slower than if using the default (RakNet) mode.

Use of the -queryport switch

The -queryport switch allows the server owner to define the specific query port that will be used for Server Browser queries, and steam Server listing queries. The -queryport switch can be used with both RakNet and Steamworks mode.

We believe that sites such as Battlemetrics, and other Rust server status will pull most of the basic metrics it previously pulled from the Game port, from the specified -queryport port number. For this reason, HostEZ recommends that server owners set their -queryport to their current game port. The current game port can be assigned to a different port. An example of this schema is shown below.

It is important to note that -queryport switch can be enabled without -swnet being enabled. Therefore, if server owners are experiencing problems with enabling -swnet, the server's query port can be specified without switching to the Steamworks protocol.

Here is an example of an implementation of ports using the current legacy protocol, compared to the new protocol:

Legacy Protocol Port Examples

  • Game Port: 28015
  • Rcon Port: 28016
  • Rust+ Port (App Port): 28017

New Protocol Port Examples

Example 1: using the same query port as the old game port. This is a good setup where the user does not want to maintain the same "address" for certain purposes.

  • Game Port: 28014
  • Query Port: 28015
  • Rcon Port: 28016
  • Rust+ Port (App Port): 28017

Note: By utilizing this approach when moving to the New Protocol format, we believe, based on the current understanding of this change, that server owners who use this approach will avoid any de-listing/re-listing of their server addresses with various services. However, this is only a supposition (guess), and the impacts on any server listing/ranking websites will need to be addressed by those websites individually.

Example 2: RECCOMENDED APPROACH - changing the query port to a different port than the legacy game port, to be +1 from the game port. This is consistent with how other Steam query games work, and is how HostEZ client's server are set by default. The reason why we recommend this approach is that it allows servers which advertise the server using an "A" DNS record, and the default port of 28015 to continue to do so, and allow those using a DNS record to directly connect without specifying a port.

  • Game Port: 28015
  • Query Port: 28016
  • Rcon Port: 28017
  • Rust+ Port: 28018

When will this change occur?

Originally, Facepunch had not specified a date when the change will occur. However, the change was implemented during the January 2023 wipe. Note that at this time, it appears that the Rust game can still connect to Raknet protocol servers directly, but it is possible that in the future, these servers may not show in the server browser.

What is the impact of this change on Server Browser ping / A2s Cache enabled servers?

Depending on your provider's implementation of A2s Cache, there should be little to no impact on server ping. Contact your server provider to learn more about the implementation. At HostEZ, we leverage the CosmicGuard A2s Cache system, and it is tested and works with the steamquery implementation.

Should I change my server to use -swnet and -queryport now?

HostEZ customers have already received automatic updates to the server start commands in the coming weeks, following extensive testing of our systems for this change. Facepunch is recommending that server hosts begin to enable -swnet and -queryport as soon as possible to ensure that all aspects are functional prior to the switch to Steamworks protocol.

What happens if I do not make changes to my startup command to use the new switches?

The following ports will be automatically used, assuming that your Rcon port is 28016. If these settings are manually not specified, or not configured properly, your server will likely also not be listed in the server browser. Please see the Facepunch blog post listed above for more details:

  • Game Port (Example): 28015
  • Rcon Port: 28016
  • Query Port: 28017
  • Rust+ (App Port) 28018

In the example above, the Query port is 28017, because it is +1 higher than the highest port (of either RCON or Rust +). This only occurs when the query port is not specified with the -queryport command.

What are the changes that need to be added to my starting command for my server to implement this?

To specify the query port, we recommend making the following changes to your server startup command.

Optional: Add -swnet as close to the beginning of the start command as possible to enable Steamworks mode

Add -queryport after the server.port specification

Example:

./RustDedicated -batchmode -swnet +server.port 28015 -queryport 28016 +rcon.port 28017 +app.port 28018

Does HostEZ Recommend using Steamworks (-swnet ) at this time?

As of now, we do not recommend the use of the Steamworks -swnet switch, due to problems reported with some players' connections.

How can I get help with this, or ask questions about this transition?

Customers who have questions about the implementation of Steam Query for Rust can contact us in the following places:

Discord: https://hostez.io/discord
Support Tickets: https://clients.hostez.io

You can also visit https://hostez.io/rust to learn more about our Rust server products.


Source: https://rust.facepunch.com/news/prototype-17#AnnouncementSteamNetworkingQueryPort
Acknowledgements: We would like to recognize PurpleFlagHosting.com for their collaboration on this article.

Please rate this article to help us improve our Knowledge Base.

10 0