Jump to content
Setting up an AI agent? ReverseEngineering.wiki skill (works from the command line, no configuration): https://reverseengineering.wiki/skill/rewiki/SKILL.md · setup for every client, including MCP: https://reverseengineering.wiki/llms.txt · REWiki:Connect

Library:GameNetworkingSockets

From ReverseEngineering.wiki
Library
Developer Valve
License BSD-3-Clause
Website https://github.com/ValveSoftware/GameNetworkingSockets
On this wiki Facts · Code · Notes · Topics

Valve's open source (BSD-3-Clause) transport library, the code behind the Steam client's ISteamNetworkingSockets: encrypted reliable/unreliable messages over UDP with a certificate-based handshake, protobuf control messages (ids 32-37) and a compact SNP frame format.

Overview

The standalone build exports a flat C API (GameNetworkingSockets_Init, GameNetworkingSockets_Kill, SteamNetworkingSockets_*) from GameNetworkingSockets.dll / libGameNetworkingSockets.so. Inside Steam games the same interface comes from the Steam client through Library:Steamworks API with the version string SteamNetworkingSockets0NN (012 in the open repository's header at commit d534c19aa760df3fb75fd20db13ba1932b8a5463; the Steamworks headers of SDK 1.65 use 013).

Identifying it

  • Direct UDP packets: a first byte below 32 is a data packet (flags byte of UDPDataMsgHdr); 32-37 is a control message whose body is a protobuf. Control messages are padded to at least 512 bytes.
  • Strings: protobuf names CMsgSteamSockets_UDP_ConnectRequest, CMsgSteamDatagramCertificate, k_ESteamNetworkingSocketsCipher_AES_256_GCM, config names such as MTU_PacketSize.
  • Crypto: AES-256-GCM (12-byte tag) with Curve25519 identity keys; OpenSSL, libsodium or BCrypt backends (src/common/crypto_*.cpp).

Wire format

See the facts on this page and src/steamnetworkingsockets/clientlib/SNP_WIRE_FORMAT.md in the repository (frame type byte layouts for unreliable/reliable segments, stop-waiting and ack frames).

Code & repositories

Related

Library:Steamworks API, Library:ENet.