Game Networking Weekly #4

, part 4 of 4 in Game Networking Weekly

Determinism in League of Legends: Unified Clock Wayback archive pending — save rate-limited

Covers game clock unification and network clock synchronization as part of League of Legends push towards server determinism. Goes over several pitfalls and tricky edge cases and presents an argument for explicit, if verbose, unambiguous time APIs.

This is a fantastic article in a fantastic series and includes some meaty info and additional references to dig into. Their clock synchronization is largely based on NTP, but modified to fit the needs of their game.

One part I find unclear is their description of a situation where they “clamp the elapsed time to 0”. Specifically, I wonder if they are actually stepping the simulation with a 0 dt or if their scheduler will skip simulation in that case. If they merely guarantee a non-decreasing timestamp instead of a strictly increasing timestamp I worry about rare bugs like divide-by-zero for a clamped dt.

ASCII skull and crossbones above a warning about the complexity of Riot’s clock synchronization code.

Game Networking Weekly was created under Riot Games’ “Legal Jibber Jabber” policy using assets owned by Riot Games. Riot Games does not endorse or sponsor this project. Riot Games policy

Between the Lanes: Denying Denial of Service Wayback (partial)

Describes Valve’s Steam Datagram Relay (SDR) system. DDoS attacks disrupted Dota 2 and CS:GO matches and even The International. So Valve decided to do something about it: they moved their game servers behind authenticated relays. These relays keep game-server addresses hidden and if a relay becomes unavailable clients simply switch to another. Now to disrupt a match requires being able to overwhelm essentially the entire data center.

They then realized they can route traffic through these relays into their virtual private network early and avoid the inconsistent routing of the open internet as much as possible. Internet routing uses BGP which generally optimizes for cost and behind SDR Valve can instead optimize for latency within their private network.

This one is light on details but the system is very similar in spirit to the system discussed in the Riot article last week.

A crowded Dota 2 tournament arena with large overhead match screens.

Sending millions of packets per-second with AF_XDP Wayback

Describes building a Linux UDP packet generator for load testing using AF_XDP. Fiedler reports sending 6 million 100-byte UDP packets/sec on one core, reaching 10–11 million packets/sec with smaller packets over 10Gb Ethernet.

AF_XDP is a way to make packet I/O look more like submitting work to a GPU: shared buffers, descriptor rings, and explicit ownership. You gain efficiency from bypassing much of the normal Linux networking stack, but like explicit graphics APIs, with great power comes great responsibility.