What is A2S or Source Engine Query Caching / Anycast?
A

Lead Engineer @ Packetware

What is A2S or Source Engine Query Caching / Anycast?

Source Engine Query

A2S/Source Engine Query caching is a feature that is used in online gaming servers. Specifically, it's used with the Source game engine, which is a popular engine used in many online multiplayer games such as Counter-Strike: Global Offensive and Team Fortress 2. The A2S in A2S/Source Engine Query caching stands for "Address to String", which is a type of query that is used to retrieve information about a server.

When a player wants to connect to a game server, they need to know the IP address and port number of the server. The A2S query is used to retrieve this information, as well as other information about the server such as the number of players currently connected and the map that is currently being played.

However, constantly sending A2S queries to a server can be resource-intensive and can put a strain on the server's resources. This is where A2S/Source Engine Query caching comes in. A2S/Source Engine Query caching is a way to store the results of A2S queries in a cache so that they can be retrieved more quickly and with less strain on the server's resources.

The A2S/Source Engine Query cache is typically stored on the client side, meaning that it is stored on the player's computer rather than on the server. This means that each player will have their own cache, which will be updated as they connect to different servers.

The cache is used to store information about servers that a player has connected to in the past. When the player wants to connect to a server, the client will first check its cache to see if it already has information about that server. If it does, it will use the cached information instead of sending a new A2S query to the server. This can help to reduce the strain on the server's resources and can also help to speed up the process of connecting to a server.

In addition to reducing strain on the server's resources and speeding up the process of connecting to a server, A2S/Source Engine Query caching can also help to reduce network traffic. Because the client can use cached information instead of sending a new A2S query to the server, this can help to reduce the amount of data that needs to be sent over the network.

In our setup we choose to to cache the packets on our network firewall such that an attacker cannot use a resource exhaustion style attack on your game servers, it has a unfortunate side effect that ping shown in the server browser can be fraudulent and shown as the closes network point of presence we have to the player querying your server. However this can be mediated by server lists choosing to list servers by region as its a good estimate of latency a player would have when connecting if they can select the continent they reside in.

Overall, A2S/Source Engine Query caching is an important feature that is used in many online multiplayer games. By storing the results of A2S queries in a cache, it can help to reduce strain on the server's resources, speed up the process of connecting to a server, and reduce network traffic.

Anycast

Anycast is a technique used in computer networks that allows multiple devices or servers to share the same IP address, and the routing infrastructure directs incoming packets to the closest or most appropriate device based on various factors such as network topology, traffic conditions, or administrative policies. In other words, with anycast, multiple servers across different geographic locations can have the same IP address, and the network routes incoming packets to the server that is topologically closest to the sender, based on the routing algorithm in use.

How do these work together?

We can pool more bandwidth and computing power to stop A2S query related attacks using the distributed network and advertising client IPs from each point of presence so that traffic is scrubbed or delivered from cache at each one to linearly increase capacity.